Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 05, 2007 10:02
open dhtmlx forum
Say my database table has a USERNAME column. When displaying in xgrid, I would like to display the NAME ...

Say my database table has a USERNAME column. When displaying in xgrid, I would like to display the NAME of the user, which is located in a different table. Can I do a JOIN operation (say, in MYSQL) and pass the results to your software and successfully display the NAME? (so the question is… will your software handle column aliases) If so, how will AJAX database writes to the original table occur?

Do you think it would be easy or difficult to modify thee code to support JOIN operations for data display, while still only editing the contents of one main table.

Answer posted on Mar 05, 2007 10:02

It is can already be done (without changes in core) for dhtmlxGrid 1.0 component. The "get" and "update" server side handlers can be initialized by different XML, so it is not a problem to create a XML config with JOIN for "get", and one table XML for "update" handler.

 

The join can be achieved in next way (only for get handler!):

<?xml version="1.0"?>

<data>

    <table name="grid INNER JOIN grid_ext ON grid.pk=grid_ext.fk">

        <key name="pKey">gr_id</key>

        <param name="data1">c0</param>

        <param name="data2">c1</param>

        <param name="data3">c2</param>

        <param name="data4">c3</param>

        <param name="data5">c4</param>

        <param name="data6">c5</param>

        <param name="data7">c6</param>

        <param name="data8">c7</param>

      <where></where>

   </table>

   <action>!nativeeditor_status</action>  

</data>
Answer posted by radyno (Support) on Dec 06, 2014 11:48

I hope this information will be enough for you. But you also can have a look at javascrip calendar and upload progress bar ajax.