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'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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.