0

I tried to change the text of the dialog, but when I need again the original dialog, it already not good any more

if you have better idea to force the user to select row when he add a new row I will be vary happy. //ADD

    url: 'Handler.ashx',
    closeOnEscape: true,
    closeAfterAdd: true,
    reloadAfterSubmit: true,      
    drag: true,
    beforeShowForm: function (frm) {
        if ($("#Grid1")[0].p.selrow == null) {                       
            $("#TblGrid_Grid1").text("Please, select row");
            $("#edithdGrid1").text("Warning!");
            $("#cData").text("OK");
            $("#sData").hide();
        }

        }



    },

1 Answers1

0

You can disable Add button if no row is selected. See the answer for more details. To disable the button you need just add ui-state-disabled class to the "Add" button. The id of Add button is "add_Grid1" if the id of the table is Grid1. Inside of beforeSelectRow you can remove ui-state-disabled class to enable the button. If the grid reloaded (inside of loadComplete) and no rows selected you can disable the Add button too.

One more option will be to hide the button instead of making it disabled. See the answer for more details.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798