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

RadGrid client command not giving access to get_itemIndexHierarchical() (JS error "is not a function")

1 Answer 80 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 23 Jun 2016, 11:34 AM

Here is my code:

 

function RadGrid1_Command(sender, args) {
               var commandName = args.get_commandName();
               if (commandName == "RebindGrid")
               {                  
                   var editedrow = args.get_itemIndexHierarchical();

                   //var itemIndex = args.get_commandArgument();

                   var master = $find('<%= RadGrid1.ClientID %>').get_masterTableView();
 
                   $.ajax({
                       type: "POST",
                       url: "Default.aspx/...",
                       data: "{year: 1}",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function (data) {
                           var response = data.d;
                           alert(response.message);
                       }
                   });
               }               
           }

I can't get the row index from get_itemIndexHierarchical() (JS error function does not exist). Also get_commandArgument() is blank if  I try that.

 

Can anyone help?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 27 Jun 2016, 08:27 AM
Hi Tom,

Note that you can access the CommandName and CommandArgument via the arguments of the OnCommand handler. When the command is "Rebind" there is no need for additional arguments, thus the get_commandArgument() merhod returns an empty string.

With that said, would you elaborate in more detail on what is the behavior that you would like to implement?

Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Ajax
Asked by
Tom
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or