Value from a text field shows up in an autocomplete field in Chrome when back button is pressed

2 posts, 0 answers
  1. Troy
    Troy avatar
    10 posts
    Member since:
    Mar 2012

    Posted 07 Oct 2013 Link to this post

    I have a page with 4 autocomplete fields and one text field all in a row. The fields are used to apply filters to a grid. When I enter something in the plain text field, and apply the filters to the grid, everything works fine. The filters are applied and the data in the grid is reduced. When I then click a link in the grid to view the detail page for the record, and then click the back button to get back to the grid, the value that was in the text field is displayed in the first autocomplete box for some reason. 

    I save the grid state to localStorage using the dataBound event of the grid:

        dataBound: this.saveGridState

    Where this.saveGridState is: 

    var grid = $('.grid').data('kendoGrid');
      var dataSource = grid.dataSource;
      var state = JSON.stringify({
        pageSize: dataSource.pageSize(),
        sort: dataSource.sort(),
        filter: dataSource.filter()
      localStorage.setItem('gridState', state);

    I load the state when the document is ready using:
        var state = JSON.parse(localStorage.getItem('gridState'));
        var grid = $('.grid').data('kendoGrid');
        if(state && Object.keys(state).length > 0) {
          if(state.filter && state.filter.filters) {
        else {

    I initially thought that the function I use to put the filters back into their inputs was mistakenly putting the data in the wrong field. However, if i set a breakpoint in chrome before any of the kendo related javascript, I still see the value in the wrong field. It appears the autocomplete is somehow persisting the value in the plain text field when I browse to the detail page and sticking it in the first autocomplete. Seems really weird. Any idea what this could be?


  2. Kiril Nikolov
    Kiril Nikolov avatar
    2598 posts

    Posted 10 Oct 2013 Link to this post

    Hello Troy,

    I was not able to see the AutoCompletes that you are referring to in the code that you posted. Could you please extract a runnable demo showing the issue that you are describing, so it will be easier for us to narrow down the problem?

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top