NotificationStore.js 941 Bytes


var writer = new Ext.data.JsonWriter({
    type: 'json',
    encode: false,
    listful: true,
    writeAllFields: true,
    returnJson: true
});

var reader = new Ext.data.JsonReader({
    totalProperty: 'total',
    successProperty: 'success',
    idProperty: 'id',
    root: 'notifications'
});



function make_base_auth(user, pass) {
  var tok = user + ':' + pass;
  var hash = $.base64.encode(tok);
  
  console.log(hash);
  return "Basic " + hash;
}




var proxy = new Ext.data.HttpProxy({
    reader: reader,
    writer: writer,
    type: 'ajax',
    api: {
    // read: '/GetNotifications'
	 read: '/Notification/GetNotifications'
    },
    headers: {
        'Content-Type': 'application/json; charset=UTF-8'
		
		
    }
});

Ext.define('App.store.NotificationStore', {
    extend: 'Ext.data.Store',
    model: 'App.model.Notification',
 //   pageSize:10,
  autoLoad: true,
    paramsAsHash: true,
    proxy: proxy
});