function stock_blocks(){ Ext.Loader.setConfig({enabled: true}); Ext.Loader.setPath('Ext.ux', 'ux/'); Ext.require([ 'Ext.grid.*', 'Ext.data.*', 'Ext.util.*', 'Ext.grid.PagingScroller' ]); Ext.define('MODEL_scroll_egg', { extend: 'Ext.data.Model', fields: [ 'stock_id', 'stock_date_add', 'stock_data_region', 'stock_data_title', 'stock_data_classification', 'stock_data_egg_type', 'stock_data_egg_color', 'stock_data_price_fix', 'stock_data_price_fix_msk', 'stock_data_price_ot', 'stock_data_price_do', 'stock_data_price_ot_msk', 'stock_data_price_do_msk', 'stock_user_id' ], idProperty: 'stock_id' }); // create the Data Store var store_sell = Ext.create('Ext.data.Store', { id: 'store_sell', pageSize: 100, model: 'MODEL_scroll_egg', remoteSort: true, // allow the grid to interact with the paging scroller by buffering buffered: true, proxy: { // load using script tags for cross domain, if the data in on the same domain as // this page, an HttpProxy would be better type: 'jsonp', // url: 'http://www.sencha.com/forum/remote_topics/index.php', url: 'controller/scroll_grid.php/sellegg', extraParams: { total: 50000, start: 0 }, reader: { root: 'topics', totalProperty: 'totalCount' }, // sends single sort as multi parameter simpleSortMode: true }, sorters: [{ property: 'stock_date_add', direction: 'DESC' }] }); var grid_store_sell = Ext.create('Ext.grid.Panel', { width: '100%', height: 236, store: store_sell, /////verticalScrollerType: 'paginggridscroller', loadMask: true, disableSelection: true, invalidateScrollerOnRefresh: false, viewConfig: { trackOver: false }, // grid columns // {xtype: 'rownumberer',width: 30, sortable: true}, // xtype: 'numbercolumn', format: '0.00', columns:[{ hidden: true, text: "Лот", dataIndex: 'stock_id', width: 40, sortable: true },{ text: "Добавлено", dataIndex: 'stock_date_add', width: 80, sortable: true },{ text: "Наименование", dataIndex: 'stock_data_title', flex: 1, sortable: true },{ text: "Сорт", dataIndex: 'stock_data_classification', width: 45, sortable: true },{ hidden: true, text: "Тип яйца", dataIndex: 'stock_data_egg_type', width: 80, sortable: true },{ text: "Цвет", dataIndex: 'stock_data_egg_color', width: 45, sortable: true },{ text: "Регион", dataIndex: 'stock_data_region', width: 60, sortable: true },{ text: "Цена", dataIndex: 'stock_data_price_fix', width: 65, sortable: true },{ text: "Цена,от", dataIndex: 'stock_data_price_ot', width: 65, sortable: true },{ text: "Цена,до", dataIndex: 'stock_data_price_do', width: 65, sortable: true },{ text: "МСК", dataIndex: 'stock_data_price_fix_msk', width: 55, sortable: true },{ text: "МСК,от", dataIndex: 'stock_data_price_ot_msk', width: 65, sortable: true },{ text: "МСК,до", dataIndex: 'stock_data_price_do_msk', width: 65, sortable: true },{ text: "Контакты", dataIndex: 'stock_user_id', width: 200, sortable: true }], dockedItems: [{ xtype: 'toolbar', items: [{ xtype: 'tbtext', text: '
Продам яйцо куриное: + Добавить лот(продажа)   Показать:   
' },{ iconCls: 'icon-refresh', text: 'Обновить', handler: function(){ change_region_sell(); } }] }], renderTo: 'scroll_egg_sell' }); function change_region_sell(){ var CH_region_sell = document.getElementById("CH_region_sell").value; var CH_gost_sell = document.getElementById("CH_gost_sell").value; var DELEM=''+ CH_region_sell +':'+ CH_gost_sell +''; setCookie ('egg_region_gost_sell', DELEM, 'Mon, 01-Jan-2201 00:00:00 GMT', '/') store_sell.load(); }; function setCookie (name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } // trigger the data store load ////store_sell.guaranteeRange(0, 99); store_sell.load(); Ext.define('MODEL_scroll_egg', { extend: 'Ext.data.Model', fields: [ 'stock_id', 'stock_date_add', 'stock_data_region', 'stock_data_title', 'stock_data_classification', 'stock_data_egg_type', 'stock_data_egg_color', 'stock_data_price_fix', 'stock_data_price_fix_msk', 'stock_data_price_ot', 'stock_data_price_do', 'stock_data_price_ot_msk', 'stock_data_price_do_msk', 'stock_user_id' ], idProperty: 'stock_id' }); // create the Data Store var store_buy = Ext.create('Ext.data.Store', { id: 'store_buy', pageSize: 100, model: 'MODEL_scroll_egg', remoteSort: true, // allow the grid to interact with the paging scroller by buffering buffered: true, proxy: { // load using script tags for cross domain, if the data in on the same domain as // this page, an HttpProxy would be better type: 'jsonp', // url: 'http://www.sencha.com/forum/remote_topics/index.php', url: 'controller/scroll_grid.php/buyegg', extraParams: { total: 50000, start: 0 }, reader: { root: 'topics', totalProperty: 'totalCount' }, // sends single sort as multi parameter simpleSortMode: true }, sorters: [{ property: 'stock_date_add', direction: 'DESC' }] }); var grid_store_buy = Ext.create('Ext.grid.Panel', { width: '100%', height: 236, store: store_buy, ///verticalScrollerType: 'paginggridscroller', loadMask: true, disableSelection: true, invalidateScrollerOnRefresh: false, viewConfig: { trackOver: false }, // grid columns // {xtype: 'rownumberer',width: 30, sortable: true}, // xtype: 'numbercolumn', format: '0.00', columns:[{ hidden: true, text: "Лот", dataIndex: 'stock_id', width: 40, sortable: true },{ text: "Добавлено", dataIndex: 'stock_date_add', width: 80, sortable: true },{ text: "Наименование", dataIndex: 'stock_data_title', flex: 1, sortable: true },{ text: "Сорт", dataIndex: 'stock_data_classification', width: 45, sortable: true },{ hidden: true, text: "Тип яйца", dataIndex: 'stock_data_egg_type', width: 80, sortable: true },{ text: "Цвет", dataIndex: 'stock_data_egg_color', width: 45, sortable: true },{ text: "Регион", dataIndex: 'stock_data_region', width: 60, sortable: true },{ text: "Цена", dataIndex: 'stock_data_price_fix', width: 55, sortable: true },{ text: "Цена,от", dataIndex: 'stock_data_price_ot', width: 65, sortable: true },{ text: "Цена,до", dataIndex: 'stock_data_price_do', width: 65, sortable: true },{ text: "МСК", dataIndex: 'stock_data_price_fix_msk', width: 55, sortable: true },{ text: "МСК,от", dataIndex: 'stock_data_price_ot_msk', width: 65, sortable: true },{ text: "МСК,до", dataIndex: 'stock_data_price_do_msk', width: 65, sortable: true },{ text: "Контакты", dataIndex: 'stock_user_id', width: 200, sortable: true }], dockedItems: [{ xtype: 'toolbar', items: [{ xtype: 'tbtext', text: '
Куплю яйцо куриное: + Добавить лот(покупка)   Показать:   
' },{ iconCls: 'icon-refresh', text: 'Обновить', handler: function(){ change_region_buy(); } }] }], renderTo: 'scroll_egg_buy' }); function change_region_buy(){ var CH_region_buy = document.getElementById("CH_region_buy").value; var CH_gost_buy = document.getElementById("CH_gost_buy").value; var DELEM=''+ CH_region_buy +':'+ CH_gost_buy +''; setCookie ('egg_region_gost_buy', DELEM, 'Mon, 01-Jan-2201 00:00:00 GMT', '/') store_buy.load(); }; function setCookie (name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } /// trigger the data store load /// store_buy.guaranteeRange(0, 99); store_buy.load(); }