This is a migrated thread and some comments may be shown as answers.

On Client-side Insert/Edit Start Event in Telerik RedGrid?

2 Answers 36 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ABC
Top achievements
Rank 1
ABC asked on 22 Sep 2013, 08:43 AM
I am using Telerik in ASP.NET 4.0. Is there is any client side event which triggered when the edit or insert form show? I need to perform some action in that event. pageLoad is not executing.

2 Answers, 1 is accepted

Sort by
0
ABC
Top achievements
Rank 1
answered on 22 Sep 2013, 09:02 AM
For now I am using,

            Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoad);

0
Princy
Top achievements
Rank 2
answered on 23 Sep 2013, 08:05 AM
Hi ,

You can try either one of the following code snippet to check whether insert or edit command has been fired.

1)Using onCommand

ASPX:
<ClientSettings>
   <ClientEvents OnCommand="onCommand"  />
</ClientSettings>

JS:
<script type="text/javascript">
    function onCommand(sender, args) {
        if (args.get_commandName() == "InitInsert") {
            //insert command
        }
        else if (args.get_commandName() == "Edit") {
            //edit command
        }
    }
</script>

2)Using OnPopUpShowing ,when EditMode="Popup"

ASPX:
<MasterTableView  EditMode="PopUp">
. . .
 <ClientSettings>
     <ClientEvents  OnPopUpShowing="popupShowing"  />
 </ClientSettings>

JS:
<script type="text/javascript">   
    function popupShowing(sender, args) {
     if (sender._editIndexes.length != 0) {         
            //edit command
        }
        else if (sender.get_masterTableView().get_isItemInserted()) {       
            //insert command
        }
    }
</script>

Thanks,
Princy

Tags
General Discussions
Asked by
ABC
Top achievements
Rank 1
Answers by
ABC
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or