0

I'm ExtJS newbie. I need to send the contents of a ExtJS Textarea to the backend server for saving (autosave facility) as the user types in. How do I buffer the contents and push the buffer to the server after some threshold value. A code sample would greatly help me. So far, I've done as below:

items: [{
    xtype: 'textarea',
    id: 'notes',
    anchor: '100%',
    height: 270,
    msgTarget: 'under',
    fieldLabel: 'Note',
    enableKeyEvents: true,
    listeners: {
        'keyup': function(textarea, event) {
            var v= textarea.getValue();
            Ext.Ajax.request({
                url: 'buffernote.action',
                params: {value: v}
            })
        }
    }
}
}]
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by jogesh_p
0

I'm ExtJS newbie. I need to send the contents of a ExtJS Textarea to the backend server for saving (autosave facility) as the user types in. How do I buffer the contents and push the buffer to the server after some threshold value. A code sample would greatly help me. So far, I've done as below:

items: [{
    xtype: 'textarea',
    id: 'notes',
    anchor: '100%',
    height: 270,
    msgTarget: 'under',
    fieldLabel: 'Note',
    enableKeyEvents: true,
    listeners: {
        'keyup': function(textarea, event) {
            var v= textarea.getValue();
            Ext.Ajax.request({
                url: 'buffernote.action',
                params: {value: v}
            })
        }
    }
}
}]

i am not familiar with the ExtJS but i think if you want auto save the content of textarea then use :

window.setInterval(myfunction, 5000);

will call the funciton named myfunction() in every 5 Sec.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.