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 8812207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:33:13+00:00 2026-06-14T03:33:13+00:00

I am working on a project where we use KENDOUI for the front-end with

  • 0

I am working on a project where we use KENDOUI for the front-end with jQuery/Javascript coding to manage anything that we can’t do with the framework itself.

I have a KENDO Grid which needs client side sorting and here is what I am trying to do –

    var tPositiondata = _DetailsGridDS.data();
    // sort position datasource in order to bind treeview
    tPositiondata = tPositiondata.toJSON().sort(function (a, b) {
        {
            if ((a.DisplayText.localeCompare(b.DisplayText)) < 0) { return -1; }
            else if ((a.DisplayText.localeCompare(b.DisplayText)) > 0) { return 1; }
        }
    });

    //re-initialize the grid with new datasource
    $("#DivDetailsTable").empty();
    $("#DivDetailsTable").kendoGrid({
        autobind: false,
        scrollable: true,
        height: 333,
        pageSize: 10,
        dataSource: tPositiondata,
        dataBound: OnReceivedDataFromDatasource,
        columns: [
    {
        field: "UniqueValue",
        title: _ColumnHeaderUniqueValue
    },
    {
        //field: "DisplayTextTranslation",
        title: _ColumnHeaderDisplayText,
        template: '#= GetTranslation(Id) #'
    },
    {
        field: "CodeAttribute",
        title: _ColumnHeaderCodeAttribute
    },
    { command: [{ text: _ButtonEdit, className: "k-button k-button-icontext buttonEdit k-grid-Edit" }, { text: _ButtonDelete, className: "k-button k-button-icontext buttonDelete k-grid-Delete" }, { text: "&nbsp;", className: "buttonUp", width: 15 }, { text: "&nbsp;", className: "buttonDown", width: 15}], text: "", title: "&nbsp;", width: 230 }
    ],
        editable: "inline"
    });

Now the trouble is that , the variable “tPositionData” cannot be re-assigned to “_DetailsGridDS” because they are obviously not the same type or format. Because of this, my global variable “_DetailsGridDS” doesn’t have the updated sorted data. If I refer to it somewhere else in code, then I am not having sorted data.

Can someone please help me to either “undo” / “reverse” the .toJSON call after sorting so that I can re-assign it to _DetailsGridDS or can someone suggest a work-around so that my global var is always updated with latest sorted data ?

  • 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-14T03:33:14+00:00Added an answer on June 14, 2026 at 3:33 am

    Thanks a lot for all the tips. Ultimately my solution was something like this :

    function SortGrid() {
    if ($("#DivDetailsTable").data("kendoGrid") != undefined) {
        if ($("#inputSortByValueName").is(":checked")) {
            $("#DivDetailsTable").data("kendoGrid").dataSource.sort({ field: "DisplayText", dir: "asc" });
        }
        else {
            $("#DivDetailsTable").data("kendoGrid").dataSource.sort({ field: "DisplaySequence", dir: "asc" });
        }
    }
    

    }

    This worked out just fine for me. Thank you again 🙂

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

Sidebar

Related Questions

I'm working on a project that makes heavy use of jQuery tabs and Ajax.
I have a working project that Im amending, it crashes after trying to use
I'm currently working on a project where I use Zend Framework with Propel. I'm
I'm working on a project and trying to use JavaScript for validating all inputs
I'm working on a project that is trying to use context-free grammars for parsing
I'm working with a project that use Twitter API to get mentions timeline of
I'm currently working on a project that makes use of Seam/Hibernate (JPA) on MySQL.
I'm working on a project that'll use PEAR packages. Because you never know what
I'm working a project that has recurring, weekly events. Thus, I use several DateTime
I'm working on a project that will use windows role providers and I want

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.