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
400
args is empty when rowSelectionChanged event triggered
posted

Hi all,

I have selection mode: 'row' enabled. what I am trying to do is passing the value of the first cell of a row to an event handler when it is triggered.

The event is triggered when a row is selected.. However, args.row is not accessible and args.row.element[0].cells[0].textContent is undefined.

Did I miss any include files? I have included the following files.

jquery-1.5.1.min.js,

jquery.tmpl.js,

jquery-ui-1.8.11.min.js,

ig.ui.min.js

ig.ui.min.css

jquery.ui.custom.min.css

It is not so clear to me about what files should be included even I read api.

here is the code:

 features: [
                             {
                                 name: 'Selection',
                                 mode: 'row',
                                 multipleSelection: false,
                                 rowSelectionChanged: function (evt, args) {
                                     
                                     alert(args.valueOf.length);
                                     alert("i am here");
                                     alert(args.row.element[0].cells[0].textContent);
                                  
                                 }
                             }, ...

Thanks,

Betty

Parents
  • 23953
    Suggested Answer
    Offline posted

    Hi Betty,

    I guess you got this error in Internet Explorer 7/8? textContent property is available from IE 9, so you should use other method to extract cell content. For example jQuery .text() or .html() will do the trick.

    Here is how your code should look like:

    Code Snippet
    1. features: [
    2.     {
    3.         name: 'Selection',
    4.         mode: 'row',
    5.         multipleSelection: false,
    6.         rowSelectionChanged: function (evt, args) {
    7.                 alert($(args.row.element[0].cells[0]).text());
    8.         }
    9.     }
    10. ]

     

     

    Hope this helps,

    Martin Pavlov

    Infragistics, Inc.

Reply Children