Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2048
igGrid Updating and RowEditTemplate edit mode
posted

Hi,

I am using 12.2 versione and I changed GridEditMode.Row into GridEditMode.RowEditTemplate. Dialog is very cool, but I would like to understand better this kind of updating...

  1. To run the saveChanges method as in the GridEditMode.Row I changed the iggridupdatingrowaddedor iggridupdatingeditrowended event into iggridupdatingroweditdialogclosed event. Here I just check if a Done or a Cancel button was clicked before the occur of this event.
    Is this correct from your point of view? Or is there a better way to do it?
    Just to be clear, this was a sample of the old code:
        $("#grid_one").live('iggridupdatingrowadded', function () {
            $("#grid_one").igGrid("saveChanges");
        });
    And this is a sample of the new code:
        $("#grid_one").live('iggridupdatingroweditdialogclosed', function (event, ui) {
            if (event.buttons == 0) { // Ok button
                $("#grid_one").igGrid("saveChanges");
            }
        });
  2. Width and Height seem to not work...I tried different numbers (in pixel), but nothing happened. My code is right, because in the same way I am able to change Done and Cancel buttons length:
        GridUpdating updating = new GridUpdating();
        .....
        updating.RowEditDialogWidth = "400";   // or "400px"
        updating.RowEditDialogHeight = "200";   // or "200px"
        updating.RowEditDialogOkCancelButtonWidth = "70";   /or "70px"
        .....
        gridModel.Features.Add(updating);
    Buttons are rendered right, while dialog dimensions are still default ones. Is there something I am missing? For example I noted that to correctly render validators in the dialog I had to put a BodyAsParent to false...maybe I am forgetting a simple parameter...
  3. Is there the possibility to freeze the dialog without let the user resizing it?

Thank you veru much,

Flavio

Parents
  • 19693
    Verified Answer
    posted

    Hello Flavio,

    Thank you for your interest in Row Edit Template.

    1) The event that you have chosed is approproate.

    You can use it to invoke saveChanges.

    2) It appears to be development issue introduced in the RTM.

    125977 - RowEditDialogWidth and RowEditDialogHeight properties are not taken into account

    You are right that RowEditDialogOkCancelButtonWidth works properly. You may use RowEditDialogMaxHeight as a temporary workaround for RowEditDialogHeight .

    3) You should handle rowEditDialogContentsRendered event and distroy the resizable functionality

     rowEditDialogContentsRendered: function (evt, ui) {                                            

    ui.dialogElement.resizable('destroy');                    

    },

    Hope this helps.

Reply Children
No Data