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
210
How should we get the perticular Component Id in a Gridview?
posted

Hi Everybody,

 

I have a gridView having 5 rows and 5 columns , all are input text components in grid. So i want to get the (2,1) positioning component Id  either from the java script or else from  Java code in backing bean.

 

Thanks in Advance,

A.Viswanath Yadav

Parents
No Data
Reply
  • 1765
    Suggested Answer
    posted

    Hello Viswanath, Please note, input text placed in GridView are dynamically generated and contains only ‘name’attribute. If interested, please click on ‘view source’ and look for particular row value.

     

    In order to get the name/value of first element of the second row, please follow below code snippet. Hope this helps.

     

    function getRowElementName{

                var completeRows = ig.grid.instances.myForm_grid.elm.childNodes[0].childNodes[1].rows;

                var secondRow = ig.grid.instances.myForm_grid.elm.childNodes[0].childNodes[1].rows[1];

       

                var secondRow_firstElement_name = secondRow.cells[0].childNodes[0].name;

                alert(secondRow_firstElement_name);

               

                var secondRow_firstElement_value = secondRow.cells[0].childNodes[0].value;

                alert(secondRow_firstElement_value);

    }

     

    Thank you!

    Swetha

     

Children