in my code, i want to do the gird table with default sorting by last name ascending, phone number formatting with (xxx)-xxx-xxxx and replace the word null to none,for example some mobiel number is null, i want to display as none
{
field: "LName",
width: 100,
title: "Last Name",
defaultSorting: true
}, {
field: "DateOfBirth",
width: 100,
title: "Date of Birth",
type: 'date',
template: '#= kendo.toString(DateOfBirth,"MM/dd/yyyy") #'
}, {
field: "Email",
width: 230,
title: "Email"
}, {
field: "MobileNumber",
width: 100,
title: "Mobile Number"
},
any one done this before, or have idea plz help
Setting a default sort is done on the data source, and can be done like this:
Formatting a phone number is a bit trickier, as there is no built in support for formatting them. You’ll have to pull the number apart, then you can use the format function to format the number (assuming your number is formatted 1234567890):
To replace null with none use another template function. This can also apply the phone number formatting:
You’ll need to make sure that your formatPhoneNumber function is scoped so that the kendo template can access it when binding.