Hii everyone
I need to have my gird's first row selected by default on load. is there any attribute to do this.
ig:columnSelectRow is not useful for me because it has a check box and also it will not select a row by default. when i tried to take the view soruce(HTML) of the page i didn't found any code related to ig:column. As i am new to this i dont have much knowledge. please help me
I would write a little javascript to a style to the first row of the grid when the page loads. I guess you'll have to assign it to each CELL in the row, but that'll do the trick.
Best,Jim
Thanks roshan
we can select the row by this method. but the rows are not seems like selected. that is there is no color change in the row. i want the grid to be displayed as first row selected by changing the backgroud color of row
You can refer the following smaple to get better implementation use of this.
http://www.componentsforjsf.com/WebGridExamples/faces/examplePages/RowSelectionWithPersistence.jsp
Roshan
Hello Vijayada,
Using the ig:columnSelectRow, it may not possible to select only one row on pageload. The thing which you can do is to use h:selectBooleanCheckbox in the first column and bind its value attribute in your bean methd returning boolen.
If you want to make first row selected then you just need to set the "true" in your backing bean for the fild returning the boolean.
Following is the code snippets for your reference:
<ig:gridView binding="#{bean.grid}" dataSource="#{bean.gridData}" pageSize="5"> <ig:column resizable="true"> <h:selectBooleanCheckbox value="#{DATA_ROW.selected}"> </h:selectBooleanCheckbox>
<f:facet name="header"> <h:outputText value="Select"></h:outputText> </f:facet>
</ig:column>..</ig:gridView>
Note: Here " value="#{DATA_ROW.selected}" is the key part to make the check box selected for the row (selected is the ). Just use boolean value according to your need to make row selected.