Results 1 to 2 of 2

Thread: Multi store records inside one textarea

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jan 2013
    Vote Rating

    Default Answered: Multi store records inside one textarea

    I have been testing extjs4 along with cakephp and am now stuck on putting mutil store records in one single textarea
    I have the fallowing in my .js view file
    xtype: 'textarea', 
    name : 'notes',                      //notes will hold foreign_key number   
    allowBlank: true, 
    fieldLabel: 'Notes',    
    editable: false,       
    anchor: '100%' 
    This is the .js model file. File I want to call and filter (Notes store)

    extend: ''
     ,fields: [
    {name: 'id', type: 'int'}
    ,{name: 'foreign_key', type: 'int'}
    ,{name: 'user_id', type: 'int'}
    ,{name: 'user_name', type: 'string'}
    ,{name: 'notes', type: 'string'}
    ,{name: 'all', convert: function(v, record) {
    var note = '- '+record.get('notes');
    var username = ' ('+record.get('user_name')+')\r\n';
    return note , username;
    the idea is that all records containing the same foreign_key will be shown inside the textarea. fields 'all' to be exact.

    Any suggestions please?

    Thank you

  2. Try looping the store, building a string and assign that string to the textarea.

    var allText='';
    // Get a reference to the store and loop through it
    store.each(function(item, index, count) {     
        allText+=item.get('all'); // add \n for line breaks
    // Get a reference to the textarea and assign the string to it
    Good luck!

Tags for this Thread

Posting Permissions

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