Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Inga on Jun 23, 2008 03:04
open dhtmlx forum
dhtmlGrid and link

Hello. Thank you for this great product. I have a problem with my links in grid - links cannot show.

I try to add link to my grid. I use MySQL tables and get.php for XML data.
In the <head> Section I use:

    <script src="/admin/codebase/dhtmlxcommon.js"></script>
    <script src="/admin/codebase/dhtmlxgrid.js"></script>
    <script src="/admin/codebase/dhtmlxgridcell.js"></script>
    <script src="/admin/codebase/excells/dhtmlxgrid_excell_link.js"></script>
    </head><body onload="doInitGrid();">

In the get.php I use:
        print("<row id='".$row['cat_id']."'>");
            ...
            print("<cell>Edit^http://www.nothing.com/".$row['cat_id']."</cell>");
            ...
        print("</row>");    

In the initialisation of dhtmlGrid:
var mygrid;
    function doInitGrid()
    {
     mygrid = new dhtmlXGridObject('mygrid_container');
     mygrid.enableAutoHeigth(true);
     mygrid.setImagePath("codebase/imgs/");
     mygrid.setHeader("Категория,Раздел,Действия:");
     mygrid.setInitWidths("*,*,*");
     mygrid.setColAlign("left,center,left");
     mygrid.setSkin("light");
     mygrid.init();
     mygrid.load("/admin/php/get.php");
        mygrid.setColSorting("str,str,link");
        mygrid.setColTypes("ro,ro,ro");
    }

Well, and I can't see link: I see data in my Cell... "Edit^http://nothing.com....";
What are I doing wrong?

Thank you.
Answer posted by Support on Jun 23, 2008 06:28
a) column types and sorting types need to be set before data loading
b) you can specify necessary column as link ( as part of setColTypes command, not setColSorting )

        mygrid.setColSorting("str,str,str");
        mygrid.setColTypes("ro,ro,link");
        mygrid.init();