Currently when you edit a grid row you are presented with two buttons/actions related to the row that is being edited - Done and Cancel. Is it possible to add another button/action? I would like to add a button that would populate editable fields with default values specified outside of the grid. If this is possible could you please provide a sample? Many Thanks.
It turns out this is not working as expected. This is what's happening...
1) I edit one row by manually entering values
2) I do the same with a second row
3) for the third row I click the "Apply Defaults" button to populate the fields.
4) The result is that the defaults are applied to the current row and all previously edited rows.
See screenshot...
Thanks!
I figured out my mistake. Thank you!
Thanks for the prompt reply Hristo.
I added the code you provided to my page but then my grid doesn't appear. I suspect I'm missing something and the syntax is preventing the display. Do I need to add something to the "features" similar to:
features: [ { name: 'Updating', editRowStarted: 'myFunction'} ]
Could you provide more sample code so that I can put this snippet in more context?
Hello Rick,
Please find the modified sample below. It handles the editRowStarted event ans uses jquery to insert dom element that will serve as the adittional button you want. Then when this button is clicked it will update the row with predefined values. Here is a code snippet:
editRowStarted: function (evt, ui) { $(".ui-iggrid-buttoncontainer").css("margin-left", "980px")
// inserts DOm element via .append method if ($("#btnUpdateValues").length == 0) { $(".ui-iggrid-buttoncontainer").append("<span id='btnUpdateValues'></span>"); $("#btnUpdateValues").addClass("ui-iggrid-button ui-state-default ui-corner-all"); $("#btnUpdateValues").append("<span style='display: inline-block; padding: 3px 10px 5px 10px;'>Update</span>") }
// updates the row with predefined values that are holded in the rowValues object $("#btnUpdateValues").on("click", function () { $("#grid").igGridUpdating("updateRow", ui.rowID, rowValues); });}
Please review it and let me know if this works for your scenario.
Thank you for posting in the Infragistics community !
I will prepare a sample demonstrating how this can be achieved and upload it here for reference.