I want to load data form combobox and textfield data to grid.
How to do it?
Above Image : select box data in column 1 and textbox data in column 2.
Here is my Jsp Grid code:
<s:url id="remoteurl" action="" />
<sjg:grid caption="RECORDS"
gridModel="dto_plot_rep"
width="300" height="80"
href="%{remoteurl}"
id="gridtable2"
rownumbers="true"
viewrecords="true"
pager="true"
pagerPosition="centar"
navigator="true"
navigatorSearch="true"
navigatorSearchOptions="{multipleSearch:true}"
navigatorDelete="false"
navigatorEdit="false"
loadonce="true"
onCompleteTopics="cal_tot"
userDataOnFooter="true"
reloadTopics="reloadPlot"
rowNum="10"
>
<sjg:gridColumn name="m_tab_p" index="m_tab_p" title="P" width="180" align="left" search="true" searchoptions="{sopt:['eq','cn']}" sortable="true"/>
<sjg:gridColumn name="m_tab_ce" index="m_tab_c" title="C" width="180" align="left" search="true" searchoptions="{sopt:['eq','cn']}" sortable="true"/>
</sjg:grid>
The
addRowData
method lets you add rows in to your jqgrid. Docs.Let's say you can capture the data from your form in to an array
arr = [2, 4.0]
You can insert the row as follows: