0
votes

I am trying to call the string inside the store. i framed the response "Hi how are you" in server

`out.print("Hi how are you");`

i am trying to print the response.

Store

Ext.define('PracticeSencha.store.CustomStore', {
    extend: 'Ext.data.Store',
    alias : 'widget.CustomStore',
    config: {
    type: 'ajax',
        url:'sample url.jsp',
        storeId: 'productStoreID'
    },
    reader: {
        type: 'text' 
    }
});

Controller

var sto = Ext.create('PracticeSencha.store.CustomStore');
        sto.load({
            scope : this,
            callback : function(records, operation, success,failure) {
                console.log(records);
                console.log(operation);
                console.log(success);
                console.log(sto.count());
            }
        });

Whether we can read the normal string using Reader?

1

1 Answers

0
votes

That's possible. Create your own TextReader by extending Ext.data.reader.Reader. Haven't done it yet, but I guess you must override the getResponseData-method at least.