Menu

Default Natural Sorting DataTable using script

$('#dataTable').dataTable({
            aoColumnDefs: [ {
                  bSortable: false,
                  sType: "numeric",
                  aTargets: [0], // cell target
                  mRender: function (data, type, full) {
                           if (type === "sort") {
                              var regX = /(<([^>]+)>)/ig;
                              data = data.replace(regX, "");
                              data = data.replace(/\//g, '');
                          }
                        return data;
                  }
              }] 
        })

Leave a comment

Your email address will not be published. Required fields are marked *