M
M
Max DangerPro2016-11-24 03:28:26
Yii
Max DangerPro, 2016-11-24 03:28:26

Mass transfer of articles from different categories into a single other category?

How to implement mass transfer of articles from different categories into a single category.
Made an admin. It has 2 tables: categories and articles. Both generated through Gii. Made a connection between the modules. The bottom line is that in any category there can be many articles, but one article can be in only one category. I can change the category of an article only when editing. And in this regard, the question arose: How to make a mass transfer of articles from different categories to any other?
How to implement it from a technical point of view. I have this option: when all the articles are displayed in a GridView, I display a CheckboxColumn. Then I have no idea at all how to transfer the selected articles to the specified category. But what, how and where to write - I have no idea. I don't know OOP very well. And Yii2 just started learning. We were given a task, they said: "Do as you like, we don't care much. We need a result." So it started brain **stvo.
I rendered the CheckboxColumn and read in the documentation that "Users can click checkboxes to select grid rows. The selected rows can be retrieved by calling the following JavaScript code:"

var keys = $('#grid').yiiGridView('getSelectedRows');

How to use it at all? I don't know JavaScript.
If someone would write a post and record a screencast on a similar topic (Explain as for housewives), it would be great. Thanks in advance).
PS Dreaming is not harmful))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-11-24
@DangerPro

here is the simplest example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question