Results 1 to 3 of 3

Thread: encoding text with double quote

  1. #1
    Sencha User
    Join Date
    Jan 2016
    Posts
    12

    Default encoding text with double quote

    Hi,
    I have a grid which i encode it on json and save it in my database in one column( i can' t change it ) .the problem is when some inserted in some column of the grid a text with double quote.
    when I retreive this row i can't display it.
    I tried to change saving by escaping double quote but i can't
    here some code :

    Code:
         var storeValue = [];
    var allRecords = grid.store.getRange(0);
                       
    						for (i = 0; i < allRecords.length; i++) 
    						{
                                  /* var s= allRecords[i].data.toString();
                                   var s2=s.replace('"', '\"');
    						     storeValue[i] = s2;*/
                                 storeValue[i]=allRecords[i].data;
                                
    						     
    						}    
    						
    				        var gr = '';
    
    
                            if (grid.getStore().getCount() != 0)
    						{
    						   
    						   gr = Ext.util.JSON.encode(storeValue);
    }
    Regards.
    PS: the commented part is my attempt to resolve the problem

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    So you're saving a bunch of JSON into a single database field? What database are we talking about?

  3. #3
    Sencha User
    Join Date
    Jan 2016
    Posts
    12

    Default

    Quote Originally Posted by Gary Schlosberg View Post
    So you're saving a bunch of JSON into a single database field? What database are we talking about?
    Yes , it's already implemented and i can't change it.
    a Mysql database.

Similar Threads

  1. When groupHeaderTpl text contains double quote
    By foued611 in forum Ext:Bugs
    Replies: 2
    Last Post: 7 Nov 2013, 3:37 AM
  2. Replies: 7
    Last Post: 24 Jun 2013, 6:15 PM
  3. placeHolder broken when value contains double quote
    By bcoffield in forum Sencha Touch 1.x: Bugs
    Replies: 0
    Last Post: 26 Jan 2012, 2:18 PM
  4. Replies: 6
    Last Post: 13 Feb 2009, 6:14 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
  •