我的两个最高优先级是渐进增强和在线编辑。我发现渐进增强(数据表)和在线编辑(的的jqGrid ),但不能同时使用。的jQuery UI主题支持将是很好的,但是一个较低的优先级。

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

<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 将是一个非常不错的选择。

更新:

您可以使用这样的代码到你的表格转换为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
});

和然后把它钉住像在装阵数据例如

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

有一个插件数据表称为 jQuery的数据表编辑其增加了联编辑。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top