विशिष्ट कॉलम पर सॉर्टिंग को अक्षम करने के कुछ तरीके हैं।
/*
* aoColumnDefs must be an array of objects (definitions)
* each definition must contain the aTargets property that
* specifies the columns on which the definition applies
* and other properties such as bSortable, bSearchable, bVisible
*/
var aoColumnDefs = [
{
"aTargets": [0, 6],
"bSortable": false
}
];
var dataTable = $('#example').dataTable({
"aoColumnDefs": aoColumnDefs
});
अन्य, कम लचीला विकल्प स्तंभ (रों) कॉन्फ़िगर करने के लिए aoColumn
पैरामीटर का उपयोग करने है:
सबसे सीधे आगे विधि स्तंभ (रों) कॉन्फ़िगर करने के लिए aoColumnDefs
पैरामीटर का उपयोग करने है:
/*
* aoColumn must be an array of objects
* the array size must match the number of columns
* use null to tell the plugin to use default settings for that column
*/
var aoColumns = [
/* 0 */ { "bSortable": false },
/* 1 */ null,
/* 2 */ null,
/* 3 */ null,
/* 4 */ null,
/* 5 */ null,
/* 6 */ { "bSortable": false }
];
var dataTable = $('#example').dataTable({
"aoColumns": aoColumns
});
डेमो:
प्रलेखन:
स्रोत
2013-12-13 08:19:34
आप इस समस्या का समाधान है? यदि हां, तो क्या आप सही उत्तर दे सकते हैं? –