Results 1 to 5 of 5

Thread: Exception when binding store with special characters

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Oct 2012
    Posts
    7

    Default Exception when binding store with special characters

    Hi,
    when I create a panel and bind a store to it, which contains special characters (e.g. "{/test" defined as string field in model }, an error is thrown by the framework. If I add the store to the grid without binding, so no error occours.
    I created a fiddle for this issue: https://fiddle.sencha.com/#view/editor&fiddle/2iu3
    I'm using Extjs 6.2.1 and this error is also present in the newest framework version (6.6.0).

    This error only occours when the store has inline data. When the data is loaded later, it works.

    extjs_bind_bug.jpg

  2. #2
    Sencha Premium User vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    811

    Default

    Imo this is not a bug:

    1. The '{ }' are reserved symbols for the view model parser, you can't use them like this ("lastName": "{/Nicht Lustig") , it won't work on parser as it's trying to create a binding
    2. I wouldn't use/define a store with static data like this as a view model stores config, because each time the view model is created it will parse your entire data object which is bad performance-wise. I would suggest you to define that store with static data as a normal store by extending Ext.data.Store.

    EDIT: minor correction on 1.
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  3. #3
    Sencha Premium User
    Join Date
    Oct 2012
    Posts
    7

    Default

    I think yes, because it should be idependent if I'm loading the data inlie or via server request.

    This fiddle is only an example to show the bug, the data in the real application will be loaded via ajax request and after that the stores are created in the view model dynamicly and filled with this data (this is a very generic application).
    The difference is, that, if I create the store and put the data directly in the store as inline data, so I will get this error. The view model parser should not parse the content of the inline data in this way, because this data has usually no defined bindings.

  4. #4
    Sencha Premium User vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    811

    Default

    Quote Originally Posted by extjs_aja View Post
    the data in the real application will be loaded via ajax request and after that the stores are created in the view model dynamicly and filled with this data (this is a very generic application).
    I won't argue if it's a bug or not, I'm here to help. Can you elaborate in some code this, even if not an working one. Seems like your general approach is wrong. The proper one would be to do the ajax call in a controller, and in the callback load the returned data into the store, while the store is defined in the VM, this way VM won't parse the data in general.

    Also others may say that having bindings in the data it's a valid case as well:

    Screen Shot 2018-07-06 at 11.54.19.jpg
    Github https://github.com/vadimpopa
    Blogging @ : http://vadimpopa.com
    Twitter: @vadimvpopa

  5. #5
    Sencha Premium User
    Join Date
    Oct 2012
    Posts
    7

    Default

    ah, okey .. it depends on the case Currently I'm not using bindings for data which is coming from server.

    Currenty, I'm using a workaround and load the data after store creation and the guys form sencha shuld decide, if it is a bug or not, I just want make them know

    I'm loading the data via model with a rest proxy which contains also associated data (hasMany). The data form model is passed to the dynamic created stores it the view model (and this data is binded to grids in the view), so I never know, how the data looks like (this could be passwords with special characters or everything else).

    Currenty you can define inline data in a viewModel store and this data can contain special characters.

Similar Threads

  1. Replies: 1
    Last Post: 16 Feb 2015, 2:32 PM
  2. Using Special characters
    By kortovos in forum Sencha Touch 1.x: Discussion
    Replies: 8
    Last Post: 6 Dec 2012, 1:25 AM
  3. List & Store:: Grouping Special Characters like ?
    By gilles86 in forum Sencha Touch 1.x: Q&A
    Replies: 2
    Last Post: 15 Mar 2012, 12:43 AM
  4. Replies: 3
    Last Post: 9 Nov 2011, 1:47 AM

Posting Permissions

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