Dhtmlx connector with code igniter

dear DHTMLX Team,

i’ve developing dhtmlx application with code igniter as backend framwork colaborating with dhtmlx-php connector

but i found some problem when attaching #connector_text_filter, at the first filtering it’s work fine, but after the first an error occured

here is my code

client side

var base_handler='http://localhost/e-file/index.php/';

tab.addTab(id,'Agenda');
            tab.setTabActive(id);
            aGrid=tab.cells(id).attachGrid();
                aGrid.setImagePath(base_image);
                aGrid.enableSmartRendering(true);
                aGrid.clearAndLoad(base_handler+'loader/agenda/in');
                aGrid.attachEvent('OnRowDblClicked','openEditTab');

server side (application/controller/loader.php)
php connector is inside application/controller/lib

<?php
class Loader extends CI_Controller
{
function __construct()
{
    parent::__construct();
}

function agenda($key='in',$field='in_out')
    {
        if($this->_header())
        {
            $agenda=($key=='in')?'Agenda':'Verbal';
            $gc=new GridConfiguration();
            $gr=new GridConnector($this->db->conn_id);
            $gc->setHeader("ID $agenda, No. $agenda, Tanggal, Dari, Untuk, Perihal, Nomor, Jenis, Klasifikasi");
            $gc->attachHeader("#colspan,#connector_text_filter,#connector_text_filter");
            $gc->setInitWidths('80,100,80,120,120,*,150,120,80');
            $gc->setColSorting('str,str,str,str,str,str,str,str,str');
            $gc->setColColor("#d0d0d0");
            $gr->set_config($gc);
            $gr->enable_log('logs/'.date('Ymd').'.log');
            if($gr->is_select_mode())
            {
                $gr->render_sql('select * from agenda where '.$field.'=\''.$key.'\'','agenda_id','agenda_id,agenda_no,tanggal_surat,dari,untuk,perihal,nomor_surat,jenis,klasifikasi');
            }
            else
            {
                $gr->render_table('agenda','agenda_id','agenda_id,agenda_no,tanggal_surat,dari,untuk,perihal,nomor_surat,jenis,klasifikasi');
            }
        }
    }
}
?>

at firs filtering, grid load this url:
1 → localhost/e-file/index.php/loade … dhx_filter[1]=1234&dhx_filter[2]=

but after it, grid load the following url
2 → localhost/e-file/?connector=true&dhx_filter[1]=1234&dhx_filter[2]=
3 → localhost/e-file/?connector=true&dhx_filter[dhx_filter[1]=1234]=1234&dhx_filter[dhx_filter[2]=]=
4 → localhost/e-file/?connector=true&dhx_filter[dhx_filter[dhx_filter[1]=1234]=1234]=1234&dhx_filter[dhx_filter[dhx_filter[2]=]=]=

can anyone help me…?? :frowning:

Try to change following line:

$gc->attachHeader("#colspan,#connector_text_filter,#connector_text_filter");

to

$gc->attachHeader("#connector_text_filter,#colspan,#connector_text_filter");

Hi olga, thx for the appreciate, but the problem still persist,

at the first time insert a keyword ‘1’ to the text filter, filter work properly by loading this url (correct handler, /index.php/loader/agenda/in)

[b]http://localhost/e-file/index.php/loader/agenda/in[/b]?connector=true&dhx_filter[0]=1&dhx_filter[2]=

the second, i change the keyword by adding ‘2’ so keyword bcome ‘12’, connector remove this part ‘index.php/loader/in’

[b]http://localhost/e-file/[/b]?connector=true&dhx_filter[0]=12&dhx_filter[2]=

the third, connector recursively add ‘dhx_filter’ to the bracket []

http://localhost/e-file/?connector=true&dhx_filter[[b]dhx_filter[0][/b]=0]=123&dhx_filter[[b]dhx_filter[2][/b]=]=

this is the fourth,

http://localhost/e-file/?connector=true&dhx_filter[dhx_filter[0]=]=1234&dhx_filter[dhx_filter[2]=]=

Unfortunately we wasn’t able to reproduce this issue locally. What version of dhtmlxConnector do you use? Try to replace your connector.js file with file from attachment
connector.zip (1.49 KB)

it’s working great…!!

thx so much for your big support olga…

:wink:

dear all, once question again :smiley:

when i refresh the grid content, using clearAndLoad method, those error happening again…

Can you provide complete code snapshot of grid initialization?

hi olga, thx for your answer, it’s very helpful

the last problem was solved by adding this param dhx_no_header=1

aGrid.clearAndLoad(base_handler+'loader/agenda/in?dhx_no_header=1');