- },
- '|xns' : 'Roo.data',
- remoteSort : true,
- sortInfo : { field : 'filename', direction: 'ASC' },
- xns : Roo.data,
- xtype : 'Store',
- listeners : {
- beforeload : function (_self, options)
- {
- options.params = options.params || {};
- if (typeof(_this.data) == 'undefined') {
- return false;
- }
- if(_this.data.id * 1 >= 0)
- {
- options.params.onid = _this.data.id;
-
- options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
- }
- }
- },
- items : [
-
- ]
-
- },
- toolbar : {
- '|xns' : 'Roo',
- xns : Roo,
- xtype : 'Toolbar',
- items : [
- {
- '|xns' : 'Roo.Toolbar',
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
- text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'],
- xns : Roo.Toolbar,
- xtype : 'Button',
- listeners : {
- click : function()
- {
- var id = _this.form.findField('id').getValue();
-
- if(id*1 < 1){
- Roo.MessageBox.alert('Error', 'Please save the email template first');
- return;
- }
-
- var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
-
- Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
- _this.igrid.getDataSource().load({});
- });
- }
- }
- },
- {
- '|xns' : 'Roo.Toolbar',
- cls : 'x-btn-text-icon',
- icon : rootURL + '/Pman/templates/images/trash.gif',
- text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'],
- xns : Roo.Toolbar,
- xtype : 'Button',
- listeners : {
- click : function()
- {
- var s = _this.igrid.getSelectionModel().getSelected();
- if (!s || isNaN(s.id *1)) {
- Roo.MessageBox.alert("Error", "Select a image");
- return;
- }
- Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
- if (v != 'yes') {
- return;
- }
-
- new Pman.Request({
- url : baseURL + '/Roo/Images.php',
- method: 'POST',
- params : {
- _delete : s.id
- },
- success : function()
- {
- Roo.log('Got Success!!');
- _this.igrid.ds.load({});
- }
- });
- });
- }
- }
- }
- ]
-