I have a kendo dropdown in my page using the following list as data source
[{FieldOne:'def',FieldTwo:'p',FieldThree:14},
{FieldOne:'ijk',FieldTwo:'p',FieldThree:14},
{FieldOne:'lmn',FieldTwo:'p',FieldThree:14},
{FieldOne:'bcd',FieldTwo:'',FieldThree:14}]
I need to sort this data source based on FieldOne ascending and FieldTwo descending I'm using the following code to sort the data source
var dropdownlist = $("#dropdown").data("kendoDropDownList");
dropdownlist.dataSource.sort({ field: 'FieldOne', dir: 'asc' });
dropdownlist.dataSource.sort({ field: 'FieldTwo', dir: 'desc' });
Its working fine initially but if I add another object like {FieldOne:'abc',FieldTwo:'p',FieldThree:14} to the data source I'm getting the following result
[{FieldOne:'def',FieldTwo:'p',FieldThree:14},
{FieldOne:'ijk',FieldTwo:'p',FieldThree:14},
{FieldOne:'lmn',FieldTwo:'p',FieldThree:14},
{FieldOne:'abc',FieldTwo:'p',FieldThree:14},
{FieldOne:'bcd',FieldTwo:'',FieldThree:14}]
but I want the datasource sorted as
[{FieldOne:'abc',FieldTwo:'p',FieldThree:14},
{FieldOne:'def',FieldTwo:'p',FieldThree:14},
{FieldOne:'ijk',FieldTwo:'p',FieldThree:14},
{FieldOne:'lmn',FieldTwo:'p',FieldThree:14},
{FieldOne:'bcd',FieldTwo:'',FieldThree:14}]
I don't know how to achieve this I tried almost everything I know but still no result. Is there anyway that I can get the desired result???