We’re building this huge system… We’ll replace all the Ms Access based system. All the people are used to in-cell editing grids and I don’t want them to complain about multiple clicks editing tables.
So, in your experience, what grid component or solution or suggestion do you have or applied to this issue?
PD. I’ve searched across the web and didn’t found anything that convinced me.
I am designing an application for a restaurant and need to create a view for an order with an inbuilt list for the items ordered. I am looking for a way to input the items data in a table. I have tried the ztabularinputmanager with some limited success: I have been able to input new data when I input a new record but am having some problems to update data relative to an existing record. I had a look at the tutorial you suggested and the lists and collection are exactly what I need to do. I see you have worked with KO and would like to have some hint (if possible a sample code) about how to integrate it with Yii. Can you please help me? Thanks
Well, KO part is simple, you just pass json array to viewmodel, then you can do whatever you want.
View:
<script type="text/javascript">
var dg_order = new orey.DataGrid({ // this is my view model
collection: <?= CJSON::encode($collection) ?>,
});
ko.applyBindings(dg_order, document.getElementById('gridPanel'));
</script>
And now the funny part (not so funny actually).
Controller:
$list = MyModel::model()->findAll($criteria);
// I hate loops
$jsonlist = array();
foreach ($list as $item) {
$jsonlist[] = $item->json; // my own method for converting to JSON
}
Currently I have no idea how to make it better under ActiveRecord (avoiding extra loops, converting AR models to JSON using only required fields and relations and so on)
After reading your code once, I do not quite understand it. The thing is that I am quite new at PHP and newer at Yii. In fact, it is my first project in PHP with Yii. I will try to understand it. My first issue is to retrieve data from my database table into KO, display it in a table in KO where I can add or delete, then save it back to my database table. It looks like a challenge for me right now