Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jan 06, 2010 22:52
open dhtmlx forum
show dynamically value in setcoltype

I am adding dynamically column in dhtmlxgrid as per your solution it will show me dynamically column but not the below data it give me error
aeditor has no properties

i m sending u my code please tell me wht i do to add dynmically "ed" in setcoltype i am adding php code then it will not show me result



below is my code


main thing
mygrid.setColTypes("ch,link,link,ro,ro,ed,ed,txt,ed,ed,ro,dhxCalendarA,dhxCalendarA,dhxCalendarA,ed,<?php $data_t = array(); while($rows_t = mysql_fetch_array($sql)){ $data_t[]=$rows_t['setcoltype']; } echo implode(",",$data_t); ?>");
    
    

if i write statically then it will show me result but for dynamiccaly it will not show me reult

please give me solution for this






mygrid = new dhtmlXGridObject('gridbox');
        
        mygrid.setSkin("gray")
        mygrid.setImagePath("dhtmlxGrid/codebase/imgs/");
        mygrid.clearAll(0);
        //mygrid.attachHeader("Total Rows,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,-Total Actual Mandays,#cspan,#cspan,<div id=''>0</div>", ["text-align:left;"]);
    
    <?php     

                        
                        $sql = mysql_query("SELECT headName,setcoltype from dummyHead WHERE projID='$projIDs' order BY headName ASC");
                         $countDummy = mysql_num_rows($sql);
                    
                            if($countDummy<=0)
                             {
                            
                             ?>
                            
                             mygrid.setHeader("Check,Add,Del,ShotID,Shotstatus,TaskID,Taskref,Task-Note,Alloted Mandays,UserID,TaskStatus,StartDate,EndDate,Shot Priority,Actual Mandays,Supervisor");
                        mygrid.setColTypes("ch,link,link,ro,ro,ed,ed,txt,ed,ed,ro,dhxCalendarA,dhxCalendarA,dhxCalendarA,ed");    
                             <?php
                            }else {
    
                        ?>
    
        mygrid.setHeader("Check,Add,Del,ShotID,Shotstatus,TaskID,Taskref,Task-Note,Alloted Mandays,UserID,TaskStatus,StartDate,EndDate,Shot Priority,Actual Mandays,Supervisor,<?php $data = array(); while($rows = mysql_fetch_array($sql)){ $data[]=$rows['headName']; } echo implode(",",$data); ?>");
    

    mygrid.setColTypes("ch,link,link,ro,ro,ed,ed,txt,ed,ed,ro,dhxCalendarA,dhxCalendarA,dhxCalendarA,ed,<?php $data_t = array(); while($rows_t = mysql_fetch_array($sql)){ $data_t[]=$rows_t['setcoltype']; } echo implode(",",$data_t); ?>");
    
    
    
    
         <?php                 
         }
     ?>
        mygrid.setColSorting(" , , ,str,str,str,str,str,str,str,str,date,date,int,int,str")
        
        mygrid.setInitWidths("50,50,50,60,70,70,70,70,70,70,70,70,70,70,70,70,50,50");
        mygrid.attachHeader(" , , ,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter, ,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter")
        mygrid.init();
        mygrid.enableSmartRendering(true);




thank sfor previous help

waiting for reply


regards
Suraj
Answer posted by Alex (support) on Jan 11, 2010 05:51

Please  check that server-side script returns desired list of values. Moreover there shouldn't be whitespaces in this list.

If the issue still occurs, please provide the example of the list that is generated by the server-side script.