Answer the question
In order to leave comments, you need to log in
How to integrate webix into Yii2?
I'm going to use Webix elements in Yii2. In particular, I want to make it possible to edit the table (datatable) by clicking the mouse.
The whole thing is built in quite simply: I include js and css in the header, and if you write the data (data) manually, everything works. But I can’t figure out how to pull data from MySQL, and save it after editing (
On the offsite it says: “Webix widgets support several integration options with server code: the ability to use the REST API with library components, as well as any MVC framework (MVC. Net, Ruby on Rails, Yii, etc.)".
If I understand correctly, you need to convert the selected table from the database to json.
I do this:
$data = self::find()->all();
$datatable = json_encode($data, JSON_UNESCAPED_UNICODE);
but at the output I get: [{},{},{},{}]
And how then to save the edited fields in the database?
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