Datasource Field

3 posts, 0 answers
  1. Marc
    Marc avatar
    169 posts
    Member since:
    Sep 2016

    Posted 21 Jul 2017 Link to this post


    I have a dataSource with a number of fields. Is there any way to get the list of these fields, in the order specified when the datasource was created.

    I know I can get the list by using dataSource.options.schema.model.fields, however the order in alphabetical and not in the order I used when I created the datasource.


  2. Stefan
    Stefan avatar
    1579 posts

    Posted 25 Jul 2017 Link to this post

    Hello Marc,

    Currently, the desired result can be achieved if the model is set using an object variable. Then that variable can be used as a list with all of the model fields in their initial state, as the variable will not be ordered alphabetically.

    For example:

    var fields = {
        OrderID: { type: "number" },
        Freight: { type: "number" },
        ShipName: { type: "string" },
        OrderDate: { type: "date" },
        ShipCity: { type: "string" }
      schema: {
       model: {

    I hope this is helpful.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Marc
    Marc avatar
    169 posts
    Member since:
    Sep 2016

    Posted 26 Jul 2017 in reply to Stefan Link to this post

    Hi Stefan,

    Yes this is the way I had planned to do it, but wasn't sure if there was a better way, thanks!


Back to Top