List and library control sort the table based on column

@Rinu,

You can sort records in descending and ascending order using the code:

//ascending
fd.control('SPDataTable1').widget.dataSource.sort( { field: "ID", dir: "asc" });

//descending
fd.control('SPDataTable1').widget.dataSource.sort( { field: "ID", dir: "desc" });