Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8670991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:50:17+00:00 2026-06-12T18:50:17+00:00

in my code, i want to do the gird table with default sorting by

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:50:19+00:00Added an answer on June 12, 2026 at 6:50 pm

    Setting a default sort is done on the data source, and can be done like this:

    sort: { field: "LName", dir: "asc" }
    

    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):

    function formatPhoneNumber(phoneNumber) {
        var piece1 = phoneNumber.substring(0, 3); //123
        var piece2 = phoneNumber.substring(3, 6); //456
        var piece3 = phoneNumber.substring(6); //7890
    
        //should return (123)456-7890
        return kendo.format("({0})-{1}-{2}", piece1, piece2, piece3);
    }
    

    To replace null with none use another template function. This can also apply the phone number formatting:

    template: '#= (MobileNumber) ? formatPhoneNumber(MobileNumber) : "none" #'
    

    You’ll need to make sure that your formatPhoneNumber function is scoped so that the kendo template can access it when binding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Code i want to validate a domain name. For example : DomainName.com. How
I want code about sorting for particular column in GRID VIEW in Asp.net C#.
In the following code I want to replace every occurrence of U.S.A with united
With the fallowing code I want to delete the last element inside the steps
I want code in which a div fades out if mouse does not hover
I want code to run whenever I create a new object. For example, see
i want code to check whether the user in logged in or not. I
I want code for keeping 1 second delay in Flex. i.e. i want to
enter code here Want to remove items from a Main list , but give
The code I want to work: $.ajax({ type: POST, url: _Source/ajap/ajap.nlSrch.php, data: { sndJson

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.