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

  • Home
  • SEARCH
  • 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 8947887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:52:56+00:00 2026-06-15T12:52:56+00:00

I am using the Kendo UI ComboBox with an external, XML DataSource. Here’s the

  • 0

I am using the Kendo UI ComboBox with an external, XML DataSource. Here’s the DataSource code:

try
    {
        var csDataSrc = new kendo.data.DataSource(
        {
            transport:
        {
            read: "Data/StateList.xml",
            dataType: "xml",
            create: { cache: true }
        },
        schema:
        {
            type: "xml",
            data: "/States/State",
            model:
            {
                fields:
                {
                    id: "id/text()",
                    name: "name/text()"
                }
            }
        }
    });
    csDataSrc.read();
}
catch (err)
{
    log.error(err.message);
}

That creates the data source, here’s the code that creates the kendo combobox:

$("#stateList").kendoComboBox(
{
    index: 0,
    placeholder: "Begin typing Coverage State...",
    dataTextField: "name",
    dataValueField: "id",
    filter: "contains",
    dataSource: csDataSrc,
    text: $("#hdnStateName").val(),
    value: $("#hdnStateKey").val(),
    change: function(e)
    {
        $("#hdnStateKey").val(this.value());
        $("#hdnStateName").val(this.text());
    }
});

This works really well but the data for the real list is enormous and I’d like to store it in local storage with something like this:
localStorage.setItem(“state_key”, csDataSrc);
Then when the page loads instead of building and reading from the server side xml all the time, I’d like for it to be something like this:

var csDataSrc = localStorage.getItem("state_key");
if(csDataSrc === null)
{
    // create the data source with the above code
    // and store it in localStorage.
}

Then bind it here…

...kendoComboBox(
{
    ...,
    .dataSource: csDataSrc,
    ...
});

I create the data source fine, it seems to store correctly in localStorage but when you leave the page and come back the data source is always null. I can see it using the resources tab of the Chrome developer tools but it won’t bind to the combo box correctly.
Any help or if I need to elaborate on anything to make this clearer please let me know

Thanks
-s

  • 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-15T12:52:56+00:00Added an answer on June 15, 2026 at 12:52 pm

    To achieve that you can use a custom read method (link).

    transport: {
        read: function(operation) {
            var cashedData = localStorage.getItem("moviesData");
    
            if(cashedData != null || cashedData != undefined) {
                //if local data exists load from it
                operation.success(JSON.parse(cashedData));
            } else {
                $.ajax({ //using jsfiddle's echo service to simulate remote data loading
                    url: '/echo/json/',
                    type: "POST",
                    dataType: "json",
                    data: {
                        json: JSON.stringify(data)
                    },
                    success: function(response) {
                        //store response
                        localStorage.setItem("moviesData", JSON.stringify(response));
                        //pass the pass response to the DataSource
                        operation.success(response);
                    }
                });
            }                 
        }
    }
    

    Here is a working example: http://jsfiddle.net/LnTe7/12/

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

Sidebar

Related Questions

here's my kendoUI combobox using mvc3 wrapper. @(Html.Kendo().ComboBoxFor(x => x.K1State) .Name(ddK1State) .DataTextField(Name) .DataValueField(Id) .BindTo((List<StateVM>)ViewData[State])
I created a phonegap application for android using Kendo UI. Here, the problem is..
I am using knockout.js with Kendo-UI. I have this grid model: var GridModel =
I am currently using the code: @foreach (var table in Model.TableData) { foreach(var field
I am using the Telerk Kendo UI grid that loads data remotely. The QueryString
I am new to kendo ui and i am using the file upload plugin
I am using Kendo UI data Grid for displaying a large local data set
I'm using Kendo UI Grid + DataSource and I'm facing some issues interacting with
I'm trying to add new rows into a Kendo UI grid using a the
here's the combo box not using knockout-kendo, @(Html.Kendo().DropDownListFor(x => x.TaxYear) .Name(ddTaxYear) .DataTextField(Year) .DataValueField(InvestorVersionId) .BindTo(Model.AvailableVersions)

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.