jQuery UI Widgets › Forums › Grid › Grid + Knockout + everpresentrow: Does not work?
Tagged: everpresentrow, jqxgrid, Knockout
This topic contains 2 replies, has 2 voices, and was last updated by phloog 8 years, 9 months ago.
-
Author
-
Hi everybody,
I followed the knockout grid binding example (http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxknockout/index.htm#demos/jqxknockout/griddataadapter.htm), and just added an everpresentrow (added the following to the grid initialisation: showeverpresentrow: true, everpresentrowposition: “bottom”, everpresentrowactions: “addBottom reset”,).
Now, the everpresentrow stops working as soon as some operation that updates the ko binding contents (adding a row, deleting a row) is done. You can fiddle around here (I just moved the whole example to a fiddle):
You can add new rows using the everpresentrow without problems. Then, if you (for example) delete one row using the “Remove Item” button, the everpresentrow is broken.
In my own project, I stumbled across exactly this problem. Can some shed some light / has someone a workaround?
Thanks,
TimHi Tim,
As you see from the samples, the adding, removing, deleting through the buttons updates the KO observable array. The built-in ever present row uses the Grid’s methods so it would not update and should not update the ko bindings.
Best Regards,
Peter StoevHey,
yes, that is understandable. In my real-world example I’d update the underlying data after some action (add, update, …) is done using the everpresentrow.
But this topic is not about the data-update as reaction to everpresentrow events. The topic is that the everpresentrow itself breaks as soon as some KO observable array operation is done (adding / removing via the upper buttons).
You can see that adding a new row via the everpresentrow, after that, results in an empty grid row. I debugged locally and found out that the HTML input element in the everpresentrow is not correctly adressed anymore (its .val() call returns ‘undefined’).
So, this is something I’d like to know, is there a workaround (resetting the everpresentrow somehow when some changes occur in the KO observable array)?
Thanks,
Tim -
AuthorPosts
You must be logged in to reply to this topic.