Project

General

Profile

Bug #20752 » 11528_v2.diff

Administrator Admin, 2009-07-14 18:07

View differences:

typo3/sysext/recycler/res/js/t3_recycler.js (working copy)
var filterGrid = function(grid, cmp) {
var filterText = cmp.getValue();
addParameters('filterTxt', filterText);
gridDs.setBaseParam('filterTxt', filterText);
// load the datastore
grid.getStore().load({
gridDs.load({
params: {
start: 0
}
......
direction: "ASC"
},
groupField: 'table',
url: Recycler.statics.ajaxController + '&depth=' + Recycler.statics.depthSelection + '&startUid=' + Recycler.statics.startUid + '&cmd=getDeletedRecords&pagingSizeDefault=' + Recycler.statics.pagingSize + '&table=' + Recycler.statics.tableSelection
url: Recycler.statics.ajaxController + '&cmd=getDeletedRecords'
});
gridDs.baseParams = {
depth: Recycler.statics.depthSelection,
startUid: Recycler.statics.startUid,
pagingSizeDefault: Recycler.statics.pagingSize,
table: Recycler.statics.tableSelection
}
/****************************************************
* add param to grid store GET
****************************************************/
var addParameters = function(key, value) {
var grid = tabs.getComponent(0).getComponent(0);
var url = grid.getStore().proxy.conn.url;
var urlParts = url.split('?');
var params = urlParts[1].split('&');
var newParams = [];
var k = 0; // used to specify offset if we set a value
// add our new key / value to the new params if value is not ''
if ('' !== value) {
newParams[0] = key + '=' + value;
k = 1;
}
// find the key and remove it
var l = params.length;
for (var i = 0; i < l; i ++) {
if (params[i].indexOf(key + '=') != -1) {
k -= 1;
continue;
} else {
newParams[i + k] = params[i];
}
}
// make new url from http + params
url = urlParts[0] + '?' + newParams.join('&');
// set the new url for the store
grid.getStore().proxy.conn.url = url;
};
/****************************************************
* permanent deleting function
****************************************************/
......
fn: function(cmp, rec, index) {
var store = tabs.getComponent(0).getComponent(0).getStore();
var depth = rec.get('depth');
gridDs.setBaseParam('depth', depth)
store.load({
params: {
start: 0
}
});
addParameters('depth', depth);
store.load();
Ext.getCmp('tableSelector').store.load({
params: {
depth: depth
......
listeners: {
'select': {
fn: function(cmp, rec, index) {
var store = tabs.getComponent(0).getComponent(0).getStore();
var store = gridDs;
var table = rec.get('valueField');
// do not reload if the table selected has no deleted records - hide all records
......
store.filter('uid', '-1'); // never true
return false;
}
addParameters('table', table);
gridDs.setBaseParam('table', table);
store.load({
params: {
start: 0
(2-2/3)