Results 1 to 7 of 7

Thread: Grid unbindStore

  1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    23

    Default Grid unbindStore

    Hi all
    I'm not able to unbind a grid from its store. I will appreciate any help.
    I'm using ExtJS 4.2.1.
    I have a grid with its store, but the same store is shared with other widgets. I want to modify the content of the store (through the other widgets) but the grid should not update its content (i.e. it should not listen to any event the store fires).
    I know this problem could be solved by cloning the store, but I'd prefer not to clone it.
    After looking at the source code, I tried with

    Code:
    store.un('load', function () {this.unbindStore();}, this, {single: true});
    where "this" is the grid, because (of course) I need to load the store and then to unbind the grid.
    This does not work, i.e. I delete records from the store and the grid gets updated (that is what I want to avoid).
    Any idea?
    Thanks in advance

  2. #2
    Sencha User watertrac_dev's Avatar
    Join Date
    Jun 2013
    Location
    Lawrence, KS
    Posts
    48
    Answers
    12

    Default Additional information

    What other widgets are working with the store instance?

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Posts
    23

    Default

    Hi
    this is not a fixed layout but a dynamic one; there could be other grids bound to the same store and permitting user-interactions. For example: consider 2 grids: the first one showing only some information cominig with the store and it should be fixed (unbound from the store) but the other one should instead permit the user to manipulate data contained in the store.
    The widget to be unbound form the store, apart from the grid (on which now I'm investigating), could be also a chart, and unfortunately I discovered that the chart widget doesn't have the unbindStore method at all; is there any equivalent method?
    Thanks and best regards
    Davide

  4. #4
    Sencha User watertrac_dev's Avatar
    Join Date
    Jun 2013
    Location
    Lawrence, KS
    Posts
    48
    Answers
    12

    Default Rendering store to grid and then "unbinding" the store

    How about something like the following?


  5. #5
    Sencha User
    Join Date
    Apr 2008
    Posts
    23

    Default

    Hi Brian
    your code works nicely, many thanks, but it causes some (unwanted) side-effects: mouse over and cellclick event don't work anymore.
    I will try to find a way to solve those problems.
    But, according to you, if I solve the grid.unbindStore problem, do I will encounter the same side effects?
    Thanks and best regards
    Davide

  6. #6
    Sencha User watertrac_dev's Avatar
    Join Date
    Jun 2013
    Location
    Lawrence, KS
    Posts
    48
    Answers
    12

    Default

    Aside from cloning the store, I'm not sure that there's an easy way to create a read-only "view" of the store that doesn't update when store records are updated. If I come across a solution I will post an update to this thread.

  7. #7
    Sencha User
    Join Date
    Apr 2008
    Posts
    23

    Default

    very kind of you
    Thanks
    Davide

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •