Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by mahesh on Nov 08, 2009 19:04
open dhtmlx forum
dhtmlx grid, mySQL, data base updating and filtering

I am unable to filter on the mySQL data base or update. I can filter on a local XML data base using similar code, and get the arrows when I click on the top row. I have managed to get rid of the XML error, but still have trouble. I have followed with source code, and output from dataprocessor_debug. Thanks for any help you may have.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <link rel='STYLESHEET' type='text/css' href='../dhtmlxGrid/codebase/dhtmlxgrid.css'>
    
    <script src='../dhtmlxGrid/codebase/dhtmlxcommon.js'></script>
    <script src='../dhtmlxGrid/codebase/dhtmlxgrid.js'></script>    
    <script src='../dhtmlxGrid/codebase/dhtmlxgridcell.js'></script>    
<script src='../dhtmlxGrid/codebase/ext/dhtmlxgrid_srnd.js'></script>
<script src='../dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js'></script>

<script src="../dhtmlxDataProcessor/codebase/dhtmlxdataprocessor.js"></script>
<script src="../dhtmlxDataProcessor/codebase/dhtmlxdataprocessor_debug.js"></script>


    <div id="gridbox" style="width:800px;height:600px;overflow:hidden"></div>
            
                
                <p><a href="javascript:void(0)" onclick="mygrid.addRow((new Date()).valueOf(),[0,'','','',false,'na',false,''],mygrid.getRowIndex(mygrid.getSelectedId()))">Add row</a></p>
                <p><a href="javascript:void(0)" onclick="mygrid.deleteSelectedItem()">Remove Selected Row</a></p>



</head>

<body>
    
<div id="gridbox" style="width:632px; height:370px;"></div>

<script>
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath('dhtmlxGrid/codebase/imgs/');
    mygrid.setHeader("Column A, Column B");
mygrid.attachHeader("#text_filter,#text_filter");
    mygrid.setInitWidths("100,*")
    mygrid.setColTypes("txt,txt");
    mygrid.setSkin("modern");
mygrid.setColSorting("str,str");

    mygrid.init();
    mygrid.enableSmartRendering(true);
    mygrid.loadXML("connector.php");


myDataProcessor = new dataProcessor("connector.php"); //lock feed url
    myDataProcessor.init(mygrid); //link dataprocessor to the grid

</script>
</body>
</html>

[close] [clear] DataProcessor Current state
ID:3 Status: updated, valid
--------------------------------------------------------------------------------
Current mode: cell Log:
row 3 marked [updated,valid]
Initiating data sending for 3
Sending in one-by-one mode, current ID = 3
Server url: connector.php parameters
gr_id=3
c0=anewcountry
c1=727298
!nativeeditor_status=updated
Server response received details
<?xml version='1.0' encoding='UTF-8' ?><rows total_count='195' pos='0' ><row id='1'><cell><![CDATA[Afghanistan ]]></cell><cell><![CDATA[293141]]></cell></row><row id='2'><cell><![CDATA[Albania ]]></cell><cell><![CDATA[553524]]></cell></row><row id='3'><cell><![CDATA[Algeria ]]></cell><cell><![CDATA[727298]]></cell></row><row id='4'><cell><![CDATA[Andorra ]]></cell><cell><![CDATA[804756]]></cell></row><row id='5'><cell><![CDATA[Angola ]]></cell><cell><![CDATA[376164]]></cell></row><row id='6'><cell><![CDATA[Antigua and Barbuda ]]></cell><cell><![CDATA[366907]]></cell></row><row id='7'><cell><![CDATA[Argentina ]]></cell><cell><![CDATA[316613]]></cell></row><row id='8'><cell><![CDATA[Armenia ]]></cell><cell><![CDATA[816466]]></cell></row><row id='9'><cell><![CDATA[Australia ]]></cell><cell><![CDATA[410238]]></cell></row><row id='10'><cell><![CDATA[Austria ]]></cell><cell><![CDATA[894267]]></cell></row><row id='11'><cell><![CDATA[Azerbaijan ]]></cell><cell><![CDATA[815701]]></cell></row><row id='12'><cell><![CDATA[Bahamas ]]></cell><cell><![CDATA[610438]]></cell></row><row id='13'><cell><![CDATA[Bahrain ]]></cell><cell><![CDATA[908482]]></cell></row><row id='14'><cell><![CDATA[Bangladesh ]]></cell><cell><![CDATA[164149]]></cell></row><row id='15'><cell><![CDATA[Barbados ]]></cell><cell><![CDATA[793231]]></cell></row><row id='16'><cell><![CDATA[Belarus ]]></cell><cell><![CDATA[591765]]></cell></row><row id='17'><cell><![CDATA[Belgium ]]></cell><cell><![CDATA[223516]]></cell></row><row id='18'><cell><![CDATA[Belize ]]></cell><cell><![CDATA[958196]]></cell></row><row id='19'><cell><![CDATA[Benin ]]></cell><cell><![CDATA[978371]]></cell></row><row id='20'><cell><![CDATA[Bhutan ]]></cell><cell><![CDATA[733443]]></cell></row><row id='21'><cell><![CDATA[Bolivia ]]></cell><cell><![CDATA[596856]]></cell></row><row id='22'><cell><![CDATA[Bosnia and Herzegovina ]]></cell><cell><![CDATA[440752]]></cell></row><row id='23'><cell><![CDATA[Botswana ]]></cell><cell><![CDATA[803991]]></cell></row><row id='24'><cell><![CDATA[Brazil ]]></cell><cell><![CDATA[576364]]></cell></row><row id='25'><cell><![CDATA[Brunei ]]></cell><cell><![CDATA[381122]]></cell></row><row id='26'><cell><![CDATA[Bulgaria ]]></cell><cell><![CDATA[529261]]></cell></row><row id='27'><cell><![CDATA[Burkina Faso ]]></cell><cell><![CDATA[135060]]></cell></row><row id='28'><cell><![CDATA[Burundi ]]></cell><cell><![CDATA[957721]]></cell></row><row id='29'><cell><![CDATA[Cambodia ]]></cell><cell><![CDATA[953633]]></cell></row><row id='30'><cell><![CDATA[Cameroon ]]></cell><cell><![CDATA[980666]]></cell></row><row id='31'><cell><![CDATA[Canada ]]></cell><cell><![CDATA[132844]]></cell></row><row id='32'><cell><![CDATA[Cape Verde ]]></cell><cell><![CDATA[554210]]></cell></row><row id='33'><cell><![CDATA[Central African Republic ]]></cell><cell><![CDATA[667008]]></cell></row><row id='34'><cell><![CDATA[Chad ]]></cell><cell><![CDATA[255612]]></cell></row><row id='35'><cell><![CDATA[Chile ]]></cell><cell><![CDATA[662314]]></cell></row><row id='36'><cell><![CDATA[China ]]></cell><cell><![CDATA[203024]]></cell></row><row id='37'><cell><![CDATA[Colombia ]]></cell><cell><![CDATA[898566]]></cell></row><row id='38'><cell><![CDATA[Comoros ]]></cell><cell><![CDATA[703641]]></cell></row><row id='39'><cell><![CDATA[Congo (Brazzaville) ]]></cell><cell><![CDATA[292139]]></cell></row><row id='40'><cell><![CDATA[Congo, Democratic Republic of the ]]></cell><cell><![CDATA[309255]]></cell></row><row id='41'><cell><![CDATA[Costa Rica ]]></cell><cell><![CDATA[865124]]></cell></row><row id='42'><cell><![CDATA[Croatia ]]></cell><cell><![CDATA[615686]]></cell></row><row id='43'><cell><![CDATA[Cuba ]]></cell><cell><![CDATA[845898]]></cell></row><row id='44'><cell><![CDATA[Cyprus ]]></cell><cell><![CDATA[215604]]></cell></row><row id='45'><cell><![CDATA[Czech Republic ]]></cell><cell><![CDATA[257827]]></cell></row><row id='46'><cell><![CDATA[Denmark ]]></cell><cell><![CDATA[201626]]></cell></row><row id='47'><cell><![CDATA[Djibouti ]]></cell><cell><![CDATA[489648]]></cell></row><row id='48'><cell><![CDATA[Dominica ]]></cell><cell><![CDATA[759420]]></cell></row><row id='49'><cell><![CDATA[Dominican Republic ]]></cell><cell><![CDATA[174171]]></cell></row><row id='50'><cell><![CDATA[East Timor (Timor Timur) ]]></cell><cell><![CDATA[643325]]></cell></row><row id='51'><cell><![CDATA[Ecuador ]]></cell><cell><![CDATA[941897]]></cell></row><row id='52'><cell><![CDATA[Egypt ]]></cell><cell><![CDATA[417095]]></cell></row><row id='53'><cell><![CDATA[El Salvador ]]></cell><cell><![CDATA[291374]]></cell></row><row id='54'><cell><![CDATA[Equatorial Guinea ]]></cell><cell><![CDATA[509455]]></cell></row><row id='55'><cell><![CDATA[Eritrea ]]></cell><cell><![CDATA[879340]]></cell></row><row id='56'><cell><![CDATA[Estonia ]]></cell><cell><![CDATA[133847]]></cell></row><row id='57'><cell><![CDATA[Ethiopia ]]></cell><cell><![CDATA[798479]]></cell></row><row id='58'><cell><![CDATA[Fiji ]]></cell><cell><![CDATA[529182]]></cell></row><row id='59'><cell><![CDATA[Finland ]]></cell><cell><![CDATA[274970]]></cell></row><row id='60'><cell><![CDATA[France ]]></cell><cell><![CDATA[422792]]></cell></row><row id='61'><cell><![CDATA[Gabon ]]></cell><cell><![CDATA[588231]]></cell></row><row id='62'><cell><![CDATA[Gambia, The ]]></cell><cell><![CDATA[135376]]></cell></row><row id='63'><cell><![CDATA[Georgia ]]></cell><cell><![CDATA[398080]]></cell></row><row id='64'><cell><![CDATA[Germany ]]></cell><cell><![CDATA[500751]]></cell></row><row id='65'><cell><![CDATA[Ghana ]]></cell><cell><![CDATA[713874]]></cell></row><row id='66'><cell><![CDATA[Greece ]]></cell><cell><![CDATA[921405]]></cell></row><row id='67'><cell><![CDATA[Grenada ]]></cell><cell><![CDATA[357465]]></cell></row><row id='68'><cell><![CDATA[Guatemala ]]></cell><cell><![CDATA[880843]]></cell></row><row id='69'><cell><![CDATA[Guinea ]]></cell><cell><![CDATA[932350]]></cell></row><row id='70'><cell><![CDATA[Guinea-Bissau ]]></cell><cell><![CDATA[591739]]></cell></row><row id='71'><cell><![CDATA[Guyana ]]></cell><cell><![CDATA[558219]]></cell></row><row id='72'><cell><![CDATA[Haiti ]]></cell><cell><![CDATA[779886]]></cell></row><row id='73'><cell><![CDATA[Honduras ]]></cell><cell><![CDATA[568504]]></cell></row><row id='74'><cell><![CDATA[Hungary ]]></cell><cell><![CDATA[739746]]></cell></row><row id='75'><cell><![CDATA[Iceland ]]></cell><cell><![CDATA[973334]]></cell></row><row id='76'><cell><![CDATA[India ]]></cell><cell><![CDATA[710999]]></cell></row><row id='77'><cell><![CDATA[Indonesia ]]></cell><cell><![CDATA[243480]]></cell></row><row id='78'><cell><![CDATA[Iran ]]></cell><cell><![CDATA[798294]]></cell></row><row id='79'><cell><![CDATA[Iraq ]]></cell><cell><![CDATA[279506]]></cell></row><row id='80'><cell><![CDATA[Ireland ]]></cell><cell><![CDATA[755201]]></cell></row><row id='81'><cell><![CDATA[Israel ]]></cell><cell><![CDATA[146321]]></cell></row><row id='82'><cell><![CDATA[Italy ]]></cell><cell><![CDATA[632354]]></cell></row><row id='83'><cell><![CDATA[Jamaica ]]></cell><cell><![CDATA[178127]]></cell></row><row id='84'><cell><![CDATA[Japan ]]></cell><cell><![CDATA[561410]]></cell></row><row id='85'><cell><![CDATA[Jordan ]]></cell><cell><![CDATA[898170]]></cell></row><row id='86'><cell><![CDATA[Kazakhstan ]]></cell><cell><![CDATA[538993]]></cell></row><row id='87'><cell><![CDATA[Kenya ]]></cell><cell><![CDATA[210092]]></cell></row><row id='88'><cell><![CDATA[Kiribati ]]></cell><cell><![CDATA[210645]]></cell></row><row id='89'><cell><![CDATA[Korea, North ]]></cell><cell><![CDATA[959672]]></cell></row><row id='90'><cell><![CDATA[Korea, South ]]></cell><cell><![CDATA[383179]]></cell></row><row id='91'><cell><![CDATA[Kuwait ]]></cell><cell><![CDATA[348393]]></cell></row><row id='92'><cell><![CDATA[Kyrgyzstan ]]></cell><cell><![CDATA[216026]]></cell></row><row id='93'><cell><![CDATA[Laos ]]></cell><cell><![CDATA[951971]]></cell></row><row id='94'><cell><![CDATA[Latvia ]]></cell><cell><![CDATA[461983]]></cell></row><row id='95'><cell><![CDATA[Lebanon ]]></cell><cell><![CDATA[133926]]></cell></row><row id='96'><cell><![CDATA[Lesotho ]]></cell><cell><![CDATA[658569]]></cell></row><row id='97'><cell><![CDATA[Liberia ]]></cell><cell><![CDATA[199912]]></cell></row><row id='98'><cell><![CDATA[Libya ]]></cell><cell><![CDATA[640371]]></cell></row><row id='99'><cell><![CDATA[Liechtenstein ]]></cell><cell><![CDATA[403882]]></cell></row><row id='100'><cell><![CDATA[Lithuania ]]></cell><cell><![CDATA[322996]]></cell></row></rows>
row 3 marked [updated,valid]
Initiating data sending for 3
Column A Column B


Afghanistan 293141
Albania 553524
anewcountry 4520
Andorra 804756
Angola 376164
Antigua and Barbuda 366907
Argentina 316613
Armenia 816466
[etc for table data]
Answer posted by Stanislav (support) on Nov 09, 2009 04:59
It seems that you are using dyn. srnd mode and client side filtering - which is impossible combination. Client side filtering and sorting can be used only if you are loading all data to client side, in other case you need to use server side filtering|sorting. 

http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxconnector:filtering
http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxconnector:sorting
Answer posted by mahesh on Nov 09, 2009 20:02

Stan,

  Thanks, sounds like quite a conflict with incompatibility issues.  I was able to make progress with your recently released updates under latest updates to solve that problem, although I am sure I will have many others.