powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / ExtJS] Как прикрутить еще и фильтр к GridPanel с PagingToolb
2 сообщений из 2, страница 1 из 1
ExtJS] Как прикрутить еще и фильтр к GridPanel с PagingToolb
    #36527275
Фотография Ex_Soft
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
Ext.onReady(function() {
     Ext.QuickTips.init();

     var
         store=new Ext.data.JsonStore({
             url: "TestGridDataJson.aspx",
             root: 'movies',
             idProperty: 'id',
             totalProperty: 'count',
             fields: ['id', 'title', 'release_year', 'rating']
         }),
         combo = new Ext.form.ComboBox({
             id: "perpage",
             name : 'perpage',
             width:  40 ,
             store: new Ext.data.ArrayStore({
                 fields: ['id'],
                 data  : [
                     ['5'],
                     ['10'],
                     ['15']
                 ]
             }),
             mode : 'local',
             value: '5',
             listWidth     :  40 ,
             triggerAction : 'all',
             displayField  : 'id',
             valueField    : 'id',
             editable      : false,
             forceSelection: true
         }),
         bbar = new Ext.PagingToolbar({
             pageSize:  5 ,
             store: store,
             displayInfo: true,
             items: [
                 "-",
                 "Per page: ",
                 combo
             ],
             displayMsg: 'Displaying movies {0} - {1} of {2}',
             emptyMsg: "No movies found"
         }),
         grid = new Ext.grid.GridPanel({
             id: "TestGrid",
             title: 'Movies',
             store: store,
             columns: [
                 { header: "ID", width:  30 , dataIndex: 'id', sortable: true, hidden: true },
                 { id: 'title-col', header: "Title", width:  180 , dataIndex: 'title', sortable: true },
                 { header: "Rating", width:  75 , dataIndex: 'rating', sortable: true },
                 { header: "Year", width:  75 , dataIndex: 'release_year', sortable: true, align: 'center' }
             ],
             autoExpandColumn: 'title-col',
             width:  600 ,
             height:  200 ,
             loadMask: true,
             columnLines: true,
             bbar: bbar
         }),
         viewport = new Ext.Viewport({
             layout: 'border',
             renderTo: Ext.getBody(),
             items: [{
                 region: 'north',
                 xtype: 'panel',
                 height:  50 ,
                 items: [{
                     xtype: "textfield",
                     id: "tbParam1",
                     fieldLabel: "param# 1"
                 }, {
                     xtype: "textfield",
                     id: "tbParam2",
                     fieldLabel: "param# 2"
                 }, {
                     xtype: "textfield",
                     id: "tbParam3",
                     fieldLabel: "param# 3"
                 }, {
                     xtype: "button",
                     text: "Apply",
                     handler: Apply
                 }]
                 }, {
                 region: 'center',
                 xtype: 'panel',
                 items: grid
             }]
         });

     combo.on('select', function(combo, record) {
         bbar.pageSize = parseInt(record.get('id'),  10 );
         bbar.doLoad(bbar.cursor);
     }, this);
});

function Apply()
{
     Ext.getCmp("TestGrid").store.load({params: {start:  0 , limit: parseInt(Ext.getCmp("perpage").getValue(), 10 ), param1: Ext.getCmp("tbParam1").getValue(), param2: Ext.getCmp("tbParam2").getValue(), param3: Ext.getCmp("tbParam3").getValue() }});
}
Что нужно подкрутить, чтобы при юзании кнопок на PagingToolbar передавались параметры фильтра?
_________________
"Helo, word!" - 17 errors 56 warnings
Posted via ActualForum NNTP Server 1.4
...
Рейтинг: 0 / 0
ExtJS] Как прикрутить еще и фильтр к GridPanel с PagingToolb
    #36528165
Фотография Ex_Soft
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
google - сила
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
store.on('beforeload', function() {
	store.baseParams = {
		param1: Ext.getCmp("tbParam1").getValue(),
		param2: Ext.getCmp("tbParam2").getValue(),
		param3: Ext.getCmp("tbParam3").getValue()
	};
});
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / ExtJS] Как прикрутить еще и фильтр к GridPanel с PagingToolb
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]