Forum
12:45
29/09/2011
Hello,
When i use tableToGrid with the colModel option, my table always become empty.
An example of code is :
<table id="myTable">
<tr>
<th>Col1</th>
<th>Col2</th>
</tr>
<tbody>
<tr>
<td>Value1</td>
<td>Value2</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
tableToGrid("#myTable", {
height:'100%',
colModel : [ {name:'c1', index:'c1'}, {name:'c2', index:'c2'}]
});
</script>
The content of the cells ('Value1' and 'Value2') has disappeared.
If i remove the colModel option, everything works fine.
Thank you for the help.
18:24
13/09/2012
It happened the same to me.
Here is the solution:
<table id="myTable">
<tr>
<th id="idCol1">Col1</th>
<th id="idCol2">Col2</th>
</tr>
<tbody>
<tr>
<td>Value1</td>
<td>Value2</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
tableToGrid("#myTable", {
height:'100%',
colModel : [ {name:'idCol1', index:'idCol1'}, {name:'idCol2', index:'idCol2'}]
});
</script>
14:59
Moderators
30/10/2007
Hello,
You do not need to set the colModel in this case (when a id is set th the th tag)
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
39 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66