1

我的两个最高优先级是渐进增强和内联编辑。我发现了渐进式增强功能(DataTables)和内嵌编辑(jqGrid),但不是两种。支持jQuery UI主题会很好,但优先级较低。什么是最接近YUI的DataTable的jQuery近似?

更新:这就是我想象中的解决方案将类似于的例子:

<table summary="A table full of example tabular data"> 
    <caption>My Table to Progressively Enhance</caption> 
    <thead> 
    <tr> 
     <th id="colA">Column A</th> 
     <th id="colB">Column B</th> 
    </tr> 
    </thead> 
    <tbody> 
    <tr> 
     <td headers="colA">foo</td> 
     <td headers="colB">bar</td> 
    </tr> 
    <tr> 
     <td headers="colA">argle</td> 
     <td headers="colB">bargle</td> 
    </tr> 
    </tbody> 
</table> 

… insert jquery datatable stuff here … 

<script type="text/javascript"> 
    progressivelyEnhanceMyTable(); 
</script> 

回答

2

随着最新发布jqGrid,我们现在得到tableToGrid,很好地解决了网格标记问题。

5

我觉得jqGrid将是一个非常不错的选择。

UPDATE:

您可以使用这样的代码到你的表格转换为JavaScript对象

var $table = $('table'); // select your table 
var data = []; // instantiate the data array 
$('tr', $table).each(function(i, item){ // loop through the table rows 
    obj = {} // create the object to append to the data array 
    obj.name = $('td:eq(0)',$(this)).text().trim(); 
    obj.desc = $('td:eq(1)',$(this)).text().trim(); 
    data += obj; // add the object to the array 
}); 

,然后把它钉住像loading array data example

for(var i=0;i<=data.length;i++) $("#datagrid").addRowData(i+1,data[i]); 
+0

如何从充满数据的`table`中创建一个jqGrid? – 2009-07-24 12:18:39