Set the column with 'sortable' property set to true.
$('#dl').datalist({
remoteSort: false,
columns : [[
{field:'text',width:'100%',sortable:true,
formatter:function(value,row,index){
return value;
}
}
]]
})
And then you can call the 'sort' method to sort the data list.
$('#dl').datalist('sort',{sortName:'text',sortOrder:'asc'})
// or $('#dl').datalist('sort',{sortName:'text',sortOrder:'desc'})