Grid and Two connections

Hi,

i need to manage two different databases using the grid control, so i need to use two connections. One of them is r/o, and the other one is r/w.

How can i do it? Is this possible?

Thanks in advance,
Eduardo.

Please check docs.dhtmlx.com/doku.php?id=dhtm … ex_updates

Hi Olga!

thanks for the answer.

I checked the information and it was very usefull, but I think that I have an additional problem, and is that i need to build the Grid with the information of two connectors (because is from two databases).

Then, for the update,insert or delete i can use the information that you provided, but to compose the grid i think I need another workaround. I thought that maybe i can build a XML file manually with the information of the two connections, and not use the automatically mode provided with the render_sql function.

What do you think? Thanks again!

I thought that maybe i can build a XML
Yes, it can be a solution.
If you need just to load some data, the custom xml feed will work the same as connectors. Any custom script which will output xml data to the response will work fine ( be sure that your custom script sets content type of response to text/xml )

Thanks!

i’ll try with the XML option. Do you have any example using it? Because in the demos provided i can’t see one that uses this technique.

Regards,
Eduardo.

Attached php file show how it can be implemented
get.zip (738 Bytes)

Hi Stanislav!

thanks for the php example, but this is an example of the XML creation.

I’m using Java for this, and the problem is that i don’t know what methods of the API provided would be in charge of the construction of the grid using a XML created previously.

Hope that you can help me!

Hi all!

Finally I developed a Servlet that creates a grid.xml file, and in the index.html page now I load the xml generated with the command mygrid.loadXML(“grid.xml”);

Now, what is the best option to update the databases properly? using an event of the dhtmlxconnector, or try to update it with an event of the dhtmlxgrid control? Because I think that maybe now dhtmlxconnector is not neccesary in the project… what do you think?

Thanks!
Eduardo

dhtmlxConnector simplifies data saving operations for most common cases.
If you will use custom sql logic for saving - you can make custom backend, without connector on the server side.

Connector gives some benefits - parsing url parameters, forming xml response. In case of custom server side code you will need to make it by custom code ( details of parameters parsing can be found in dataprocessor’s documentation )

If you fine with the way how connector process incoming data it will be faster to still use connector and define custom logic through server side event handlers.

Thanks Stanislav!

Then i think that i’ll proceed as you indicate. I generate an xml manually, and for update/delete i’ll use the dhtmlxconnector, using the event handlers provided.

Thanks for all the information,
Eduardo.