好的,我希望我能清楚地解释清楚。
首先,代码:
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("includes/dhtmlxGrid/codebase/imgs/");
mygrid.setHeader("Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8,Col9");
mygrid.attachHeader("#text_filter,#text_filter,#select_filter,#select_filter,#text_filter,#select_filter,#text_filter,#select_filter,#select_filter,#text_filter,");
mygrid.setInitWidths("100,45,*,150,150,100,125,100,*,1");
mygrid.setColAlign("left,left,left,left,left,left,left,left,left,left");
mygrid.setColTypes("link,ro,ro,ro,link,ro,link,ro,ro,ro");
mygrid.setColSorting("str,str,str,str,str,date,str,date,str,str");
mygrid.init();
mygrid.groupBy(9);
mygrid.setSkin("dhx_skyblue");
mygrid.parse(data, "json");
我通过创建JSON对象为ColdFusion生成此网格的数据。 Col2是我想要从排序中禁用但保留其他列的排序的那个。
Col2包含一个简单的单元格,其颜色与列中其余信息中的信息相匹配。
<cell class='my_#TheColor#'> </cell>
这是生成的单元格,在使用ColdFusion生成期间通过case语句选择颜色。因此,在搜索此字段时,它会尝试搜索上面列出的HTML。
目标是a)只是禁用列或b)如果有某种方法只将颜色(红色,蓝色,白色等)发送到网格,以便可以通过选择下拉列表进行排序。 / p>
如果需要,我随时可以添加更多信息。
谢谢!
答案 0 :(得分:0)
找到答案:
我更改了此行并删除了搜索过滤器:
mygrid.attachHeader("#text_filter,,#select_filter,#select_filter,#text_filter,#select_filter,#text_filter,#select_filter,#select_filter,#text_filter,");
答案 1 :(得分:0)
你可以设置&#34; na&#34;排序类型以禁用所需列的排序:
mygrid.setColSorting("str,na,str,str,str,date,str,date,str,str");