javascript - How to stop one column from being sortable while Using JQuery UI sortable function -
i have table in jsp page starts
<table class="table table-bordered table-striped table-highlight" id="tab_logic"></table>
i adding rows table in manner through ajax call
function loaddata(data){ var htm = "<tr><th style='width: 20%'>index order</th><th style='width: 20%'>category name</th><th style='width: 20%'>category key</th><th style='width: 20%'>category id</th></tr>"; for(var = 0; < data.length; i++) { htm += "<tr><td>" + data[i].indexorder + "</td><td>" + data[i].name + "</td><td>" + data[i].catkey + "</td><td>" + data[i].id + "</td></tr>"; } $("#tab_logic").html(htm); }
now make table sortable using jquery ui plugin , using these lines
$("#tab_logic").sortable({ items: "tr:not(th)", helper: "clone", update: function() { // alert("success"); } }).disableselection(); $("#submit").click(function(){ process(); });
now want other columns except first 1 sortable. how can achieve this?
i use jquery data table populate data provides rich set of functions.
we can configure sorting columns , respective sorting direction @ instantiate time of datatable. check , see whether can used in context
https://datatables.net/examples/basic_init/table_sorting.html
Comments
Post a Comment