How can I customize the styles, and templates for the popup window when I am adding/editing a new record into the grid.
Would it be too much to ask for a sample mvc application with a grid containing 3-4 properties that illustrates what you just explained?
It'll make grasping the whole concept a lot easier :)
Hi,
Yes, it's possible to completely change the look of the popup editor template. You can do that with your own popup by using the RET events.
Step 1 - attach to the rowEditDialogOpening event and cancel it.
rowEditDialogOpening: function(event, ui) {
var tr = ui.dialogElement.data().tr; //a reference to the TR element of the table being edited
var pk_id = tr.data().id; // a reference to the PK id
var recordObj = ui.owner.grid.findRecordByKey(pk_id);
// pass the recordObj to your custom dialog and render it
return false;},
This will stop the default template from opening and on this place you can open your own popup. You will also obtain the PK id of the record being edited and after that you will have an object with all values for that record (headers and values)
Step 2 - render your custom popup and edit the fields
Step 3 - press close your custom object and update the grid using the API function. Here is an example:
$('#grid').igGridUpdating('updateRow', 1, { 'Name': 'Alex' }); // 1 is your PK_ID and the next object is a name/value collection
I hope this helps you.
Regards
Lyubo
Thanks for clarifying
full custom template for the pop up dialog is not currently supported, but we will most certainly add this either for one of the next SRs, or for 2013.1. Thanks very much for your feedback. I do agree it is an important scenario.
Thank you,
Angel
Is it possible?