Answer the question
In order to leave comments, you need to log in
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');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question