Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JS Sample
var soId = '';
var soNumber = '';
var toCartForm = new Array();
var rec;
var today = new Date();
today = new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0);
var tommorow = new Date(today.getFullYear(), today.getMonth(), (today.getDate()+1), 0, 0, 0, 0);
var resultRecord = Ext.data.Record.create([
{ name: 'id' },
{ name: 'accomodation' },
{ name: 'count_day' },
{ name: 'sum_price' },
{ name: 'currency_id' },
{ name: 'serv_id' },
{ name: 'serv_name' },
{ name: 'period_start' },
{ name: 'period_end' },
{ name: 'live' },
{ name: 'pay' },
{ name: 'early_discount' },
{ name: 'early_pax' },
{ name: 'stop_start' },
{ name: 'stop_end' },
{ name: 'is_pp' },
{ name: 'state' },
{ name: 'date_show' },
{ name: 'city_name' },
{ name: 'boards' },
{ name: 'markup' },
{ name: 'no_of_rooms' }
]);
var searchResultStore = new Ext.data.JsonStore({
//root: 'rec',
id: 'serv_id',
fields: [ 'count_day', 'sum_price', 'serv_id', 'serv_name', 'period_start', 'period_end', 'is_pp', 'accomodation', 'live', 'pay', 'stop_start', 'stop_end', 'early_discount', 'early_pax', 'markup', 'currency_id', 'city_name', 'boards', 'html', 'hotel_name', 'room_name', 'no_of_rooms', 'currency' ]
});
var shoppingCartStore = new Ext.data.JsonStore({
root: 'rec',
url: '/search/general-service/list-shopping-cart',
id: 'id',
fields: [ 'id', 'count_day', 'sum_price', 'serv_id', 'serv_name', 'accomodation', 'period_start', 'period_end', 'is_pp', 'state', 'date_show', 'from_to', 'markup', 'currency_id', 'service_id', 'room_name', 'city_name' ],
//autoload: true,
sortInfo: {
field: 'id',
direction: 'DESC'
},
listeners: {
'add': function(store, record, index) {
shoppingCartPanel.fireEvent('tableUpdate', store);
},
'beforeRemove': function(store, id) {
removeRec = dropButton.id;
removeRec = removeRec.replace('drop_btn', '');
removeRec = new RegExp("^"+removeRec+"$");
recToRemove = shoppingCartStore.find('id', new RegExp(removeRec), false );
shoppingCartStore.remove(shoppingCartStore.data[recToRemove]);
},
'remove': function(store) {
shoppingCartPanel.fireEvent('tableUpdate', store);
},
'load': function(store) {
shoppingCartPanel.fireEvent('tableUpdate', store);
}
}
});
shoppingCartStore.load();
...
var childStoreArray = [];
cityStore.on('load', function(s,r){
regionsPanel.items.each(function(item){
regionsPanel.remove(item);
});
var count = 0;
var count2 = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment