• Using onRowClick Event with Dojo Data Grid

    By bertrand goubot 1 decade ago

    Hi team,

    I wish using this event to get UNID from the current document.

    For my example, i use this one provided by "Xpages Extension Library.pdf" :

     

    <xe:this.onRowClick><![CDATA[var idx=arguments[0].rowIndex;
    
     var unid=restService1._items[idx].attributes[“@unid”];
    
     alert(“Row is “ + idx + \n + “UNID is “ + unid);]]>
    
     </xe:this.onRowClick>
    

    But for me, it's not working : i have error on restService1._items (null error javascript). Note : restService1 is right my jsId value.

    I use ExtLib Release provided by UpgradePack1.

    Do you confirm, it's possible to get UNID with this event ? do you have some other equivalent example ?

    Thanks for your advice.

    • Can you get the other attributes this way?

      By Philippe Riand 1 decade ago

      because yes, the unid is part of the row data. So you should get access to it. I don't have an example handy.

      • Sorry,but i can't any get attribute

        By bertrand goubot 1 decade ago

        Hi,

        I succes to load data in dojoGrid.

        But whenI try this : var unid=restService1._items[idx].attributes["@unid"];

        with onRowClick, i have this javascript error : restService1._items isn't defined.

        So, with dojoGrid, it's seems it's not possible to get UNID by onRowClick event, it's like a bug ?

        Thanks.

        • it is possible ;)

          By Daniel D Regojevic 1 decade ago

           

          var dataGridDij = dijit.byId(dojo.query("[id$='djzDataGrid']")[0].id);
          
          var unid = dataGridDij.selection.getSelected()[0].attributes['@unid'];
          

           

          try it.. 

          • Neither method works for me

            By Jeffrey T McQuillen 1 decade ago

            Anyone get this working and can give me an example?

            • Got it!

              By Jeffrey T McQuillen 1 decade ago

              var idx=arguments[0].rowIndex;

              var dataGridDij = dijit.byId(dojo.query("[id$='djxDataGrid1']")[0].id);

              var unid = dataGridDij._by_idx[idx].item['@unid']