Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Mike on Jan 05, 2010 21:41
open dhtmlx forum
Error: this.cells3(row, ind) is undefined Source File: [edited]/dhtmlx/dhtmlx.js Line: 6179

Source File: [edited]/dhtmlx/dhtmlx.js Line: 6179

Any ideas on this error? it is generated when trying to sort column 2. Col 0 is subrow, Col 1 is string and sorts fine. This error is generated trying to sort the int column 2 (third column). none of the columns beyond 2 sort either and all generate the error except for col 1.

grid JS:

-------------------------------------------------------------------------------------------------------------------------------------

var mygrid = new dhtmlXGridObject('gridbox');
mygrid.setHeader(" #, Client Name, Amount, Received, Lender");
mygrid.setColTypes("sub_row_ajax,ro, price, ro, ro,ro");
mygrid.setInitWidths("40,*,*,*,*")
//mygrid.enablePaging(true, 10, 1, "pagingArea", true, "recinfoArea");
mygrid.setSkin('light');
mygrid.setColSorting("int,str,int,str,str");
mygrid.init();
mygrid.enableSmartRendering(true);

mygrid.attachHeader("Filter by:<br/><input type='text' name='clientName' id='clientName'>,#cspan,Mortgage number:<br/><input type='text' name='mortgage_number' id='mortgageNumber'>,Date range:<br/><input type='text' name='startDate' id='startDate' size='10' readonly='true'> to <input type='text' name='endDate' id='endDate' readonly='true' size='10'><div style='float:right;padding-right:10px;text-decoration:none;'><a href='javascript:applyFilter()'>Apply Filter</a>   <a href='javascript:clearFilter()'>Clear Filter</a></div>,#cspan");
//mygrid.enableHeaderMenu();
mygrid.loadXML(receiptDataUrl);


------------------------------------------------------------------------------------------------------------------------------------
xml generating code:
header('Content-type: text/xml');

$resultXML = "
<xml version='1.0' encoding='utf-8'>
<rows>
";

foreach ($results as $result) {
$resultXML .= "

<row id='{$result['id']}'>
<cell><![CDATA[index2.php?option=com_payroll&task=payrollGetDisbursementsSubGrid&receiptId={$result['id']}]]></cell>
<cell>{$result['client_name']}</cell>
<cell>{$result['amount']}</cell>
<cell>{$result['received']}</cell>
<cell>{$result['received_from']}</cell>
</row>
";
}

$resultXML .= "
</rows>
</xml>
";

echo $resultXML;

Actual XML generated (2 rows only)
-------------------------------------------------------------------------------------------------------------
<xml version="1.0" encoding="utf-8">
<rows>

<row id="1">

<cell>
index2.php?option=com_payroll&task=payrollGetDisbursementsSubGrid&receiptId=1
</cell>
<cell>Jerry Test</cell>
<cell>1500</cell>
<cell>2009-12-22</cell>
<cell>First National</cell>
</row>

<row id="2">

<cell>
index2.php?option=com_payroll&task=payrollGetDisbursementsSubGrid&receiptId=2
</cell>
<cell>Test</cell>
<cell>300</cell>
<cell>2009-12-22</cell>
<cell>Firstline</cell>
</row>
</xml>
Answer posted by Stanislav (support) on Jan 06, 2010 01:42
You need to remove unnecessary whitespaces from the next js command
    mygrid.setColTypes("sub_row_ajax,ro, price, ro, ro,ro");
must be 
    mygrid.setColTypes("sub_row_ajax,ro,price,ro,ro,ro");
Answer posted by Mike on Jan 06, 2010 07:34
Wow!  Thanks.  I knew it must be a simple oversight!