Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Oct 23, 2009 00:32
open dhtmlx forum
Grid from html and column types

Hi!

I need to build grid which content will be eventually sent to the server with form submit. The grid will be initialized and populated from html table. Now I try to use ch as cell's type and I can't get it work.

Here is my html code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Grid from html table</title>
<link href="dhtmlx/dhtmlx.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="dhtmlx/dhtmlx.js"></script>
<script type="text/javascript">window.dhx_globalImgPath="dhtmlx/imgs/";</script>
</head>

<body>

<table id="grid" class="dhtmlxGrid">

<tr>
<td type="ed" align="left">Editable</td>
<td type="ch" align="left">Checkbox</td>
</tr>

<tr>
    <td>3136</td>
    <td>1</td>
</tr>
<tr>
    <td>2095</td>
    <td>0</td>
</tr>
<tr>
    <td>115</td>
    <td>0</td>
</tr>

</table>

<script type="text/javascript">

    var grid = dhtmlXGridFromTable("grid");
    
    grid.enableAutoWidth(true);
    grid.enableAutoHeigth(true);
    grid.setSizes();

</script>

</body>
</html>

Answer posted by Stanislav (support) on Oct 23, 2009 05:10
Be sure that next command provides valid path to the imgs folder
<script type="text/javascript">window.dhx_globalImgPath="dhtmlx/imgs/";</script>
Checkboxes in grid are images, so if img path was set incorrectly, they will not render