1
我有一张表,其中包含显示版本的列。这意味着值1.1不同于1.10,但作为一个数字它们是相同的,1.1 = 1.10通过具有版本信息的列对JQuery中的表进行排序
所以,我需要分离点的两侧的数字并对它们进行排序。 for.eg: 当前排序:
1.1
1.10
1.11
1.2
我要找的排序是:
1.1
1.2
1.10
1.11
我使用HTML5,引导,jQuery的MVC 我使用Ajax调用从获取数据web API。然后动态创建表格。
var str = '<br/><table id="tblBuildsGrid" class="table table-striped table-bordered table-nowrap hover order-column text-center" style="word-wrap: break-word !important;">';
str += '<thead id="buildsGridTableHeader" class="text-center overlayMainHeader"><tr>';
str += '<th style="width: 34px !important;" class="no-sort glyphicon-column sorting_disabled"></th>';
str += '<th class="text-center" id="buildVersionSortedColumn">Build Version</th>';
str += '<th class="text-center">Owner</th>';
str += '<th class="text-center">Build Type</th>';
str += '<th class="text-center">Effective Date</th>';
str += '<th class="text-center">Product</th>';
str += '<th class="text-center">Status</th>';
str += '<th class="hide"></th>';
str += '<th class="hide"></th>';
str += '<th class="hide"></th>';
str += '<th class="hide"></th>';
str += '<th class="hide"></th>';
str += '<th class="hide"></th>';
str += '<th class="hide"></th>';
str += '<th class="hide"></th>';
str += '</tr></thead>';
str += '<tbody>';
请帮忙。
你需要实现你自己的'sort()'功能。请参阅https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort –