connector_select_filter XML

Hello,

I don’t configure my grid header from javascript.
I am using a
custom php script to generate xml which is then used to build it.
"
$gridConn->set_options(“study.StudyDate”,array(“Ce jour”=>1,“Cette semaine”=>2,“Ce mois”=>3));

$gridConn->event->attach(“beforeOutput”,“grid_header”);

    function grid_header(){
        if (!isset($_GET[“posStart”]) && !isset($_GET[“connector”]))
            echo ’
                           
               
                IDPatient
                …
               
                   
                       #rspan,#rspan,#rspan,#connector_text_filter,#connector_text_filter,#connector_select_filter,…
                   
               

    }
"

But select filter stay blank.
If I use “setHeader”, “attachHeader” and other functions, my select box is filled.

One suggestion?
regards,


Hello


the information about select filters, that need to be filled, is automatically sent with the loading request to the server. If grid is configured on server, this information is unknown.


To solve the issue you should pass the index of the columns with select filters as follows:


grid.load(“some.php?dhx_colls=5”);


If there are more select filters, indexes should be passed as list. For example grid.load(“some.php?dhx_colls=5,7”);

Thanks, it’s working now.

2 others points:

a: my select_filter boxs are not automatically filled. I need to use "set_options"
function. It is normal or i don’t understand some thing?

b: the fonction “set_encoding” has no effect.
I’d need to add:

echo ‘<?xml version="1.0" encoding="'.$this->encoding.'"?>’;

in file: base_connector.php
in fonction: output_as_xml
after: header(”…”);

What do you think about my correction?

regards,

Both problems are confirmed. Please try to use use attached files instead of originals
base_connector.zip (3.89 KB)

Hello,



I tried your file but it doesn’t work.

I remove select_filter and other stuffs not necessary, and i get empty window message.

In the “some.txt”, i get only the banner:



==============================

log strated, 20/01/2010 10:01:35

==============================



I also removed my function “grid_header”, i removed attached Header and it’s the same.

sorry,

If you want more informations about my sources, tell me.

see you soon

We have forgotten to attach one more file - connector.js.
connector.zip (1.34 KB)

not better!
I get the same problems like my last answer!
regards,

Sorry… one more file has to be replaced. The archive with the files is attached.
codebase.zip (13.1 KB)

ok, i have no more my last error (empty window message).
But it’s not better, i explain:

1- If i use api (setheader(), attachheader()) with or without function “set_options()” of GetConnector, my select_filter is empty.
2- If i use event “beforeOutput” to generate xml for my header without function “set_options()”,i get the message in “some.txt”:"
!!!Uncaught Exception
Code: 0
Message: Incorrect dataset minimization, master field not found.

3- If i use with function “set_options()” it ok. but it’s not an automatic!

An other problem: (with new and last files)
if i use this code:

    $filterModa = new OptionsConnector($resultConnection);
    //if($debug) $filterModa->enable_log(“some.txt”);
    $filterModa->render_sql(“SELECT DISTINCT study.Modality as modality FROM study”,“study.Modality”,“study.Modality(modality)”,"","");
    $gridConn->set_options(“study.Modality”,$filterModa);
"
my select_filter is filled with word “null”. The number of “null” is correct.

tell me,
see you soon,
Thank you for your responsiveness.



Ok,
I found an error in your last dd_common.php:
You use the function “$this->escape_name” to add "  ’  " caracter
around column name.
But in my case, my columns names are ex: study.ID (table.column). It’s not an ALIAS.
Mysql don’t like (ex: … WHERE ‘study.ID’ LIKE ‘90’ …)
This is the error message:
"
Message: MySQL operation failed
Unknown column ‘study.ID’ in ‘where clause’
"
I changed ‘escape_name($data)’ function to return only $data.
I tried it for loading, sorting and searching data and it work fine.
I didn’t try for ‘update’, ‘delete’ and ‘insert’.

Are you working on my 2 last problems:
auto fill select_filter and ‘new OptionsConnector(…)’?

regards,

I’m sorry, if found my error about ‘new OptionsConnector(…)’.
It’s important that the alias is “value” for query:
$filterModa->render_sql(“SELECT DISTINCT study.Modality as value FROM study”,“study.Modality”,“study.Modality(value)”,"","");

thanks again,
regards.


Hello


are some of the problemss still actual ? If they are, please provide the full code of connector initialization.

Hello,

Every is ok for moment.
the only one left is filling ‘select_filter’.
For the moment i use “new OptionsConnector(…)” to fill my select_filter.
Does my recent observations, about escape_name function "is correct?

best regards,


Hello


>> For the moment i use “new OptionsConnector(…)” to fill my select_filter.


Automatic filter confirguration can fail if there are issues with method that renders grid. OptionsConnector is a good solution in this case.


>> Does my recent observations, about escape_name function "is correct?


The issue with escape_name is confirmed.


db_common.php was fixed.


Moreover we have found the issue in the connector.js that we sent you before. The correct file is attached.


db_common.zip (5.78 KB)
connector.zip (1.34 KB)