x11 Posted February 27, 2021 Share Posted February 27, 2021 Не могу понять, что я делаю не так. Нужно просто показать общую сумму в колонке. procedure TfmMain.dbgPurchasesColumnSummaryResult(Column: TUniDBGridColumn; GroupFieldValue: Variant; Attribs: TUniCellAttribs; var Result: string); Var v: variant; begin if SameText(Column.FieldName, 'SUMA') or SameText(Column.FieldName, 'KEYS_QUANTITY') then begin v := Column.AuxValue; if not VarIsNull(v) then result := v; end; end; условие выполняется, но суммы пустые У колонок свойство Summary включено, у сетки - тоже. Что я еще забыл? В качестве набора данных использую DevArt uniDAC (TUniQuery) Спасибо. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2021 Share Posted February 27, 2021 1 hour ago, x11 said: У колонок свойство Summary включено, у сетки - тоже. Что я еще забыл? А какой код в OnColumnSummary событии? Quote Link to comment Share on other sites More sharing options...
x11 Posted February 27, 2021 Author Share Posted February 27, 2021 никакого, а что там должно быть? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2021 Share Posted February 27, 2021 28 minutes ago, x11 said: никакого, а что там должно быть? \FMSoft\Framework\uniGUI\Demos\Desktop\GridSummary Quote Link to comment Share on other sites More sharing options...
x11 Posted February 27, 2021 Author Share Posted February 27, 2021 Я думал, что сетка сама умеет суммировать ок, добавил код procedure TfmMain.dbgPurchasesColumnSummary(Column: TUniDBGridColumn; GroupFieldValue: Variant); begin if SameText(Column.FieldName, 'SUMA') or SameText(Column.FieldName, 'KEYS_QUANTITY') then begin if VarIsNull(Column.AuxValue) then Column.AuxValue := 0; Column.AuxValue := Column.AuxValue + Column.Field.AsInteger; end; end; все равно пусто на что еще нужно обратить внимание? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2021 Share Posted February 27, 2021 2 hours ago, x11 said: У колонок свойство Summary включено, у сетки - тоже. ShowSummary? Quote Link to comment Share on other sites More sharing options...
x11 Posted February 27, 2021 Author Share Posted February 27, 2021 да, смотрите картинку в первом сообщении Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2021 Share Posted February 27, 2021 Извините, можете создать тестовый случай? Quote Link to comment Share on other sites More sharing options...
x11 Posted February 27, 2021 Author Share Posted February 27, 2021 Вот что я забыл сказать. Я использую сетку CustomDBGrid из этой темы http://forums.unigui.com/index.php?/topic/11857-grid-filters-list/&tab=comments#comment-63164 Т.к. вы не добавили в стандартную uniDBGrid сетку функционал Filters из extJS, приходится использовать это. Может быть вы подскажите, как использовать функционал Filters из extJS в стандартной uniDBGrid сетке? Чтобы не использовать CustomDBGrid. Я пробовал и у меня не получилось. CustomDBGridFilter.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2021 Share Posted February 27, 2021 1 hour ago, x11 said: Я пробовал и у меня не получилось. CustomDBGridFilter.rar 3.64 kB · 0 downloads procedure TMainForm.UniFormCreate(Sender: TObject); var i:integer; begin for i := 0 to Pred(UniFilterDBGrid1.Columns.Count) do TUniFilterDBGridColumn(UniFilterDBGrid1.Columns[i]).Filter:='list'; end; Quote Link to comment Share on other sites More sharing options...
x11 Posted February 27, 2021 Author Share Posted February 27, 2021 Вы не поняли. Я имел ввиду обычный стандартный uniDBGrid. Как в него добавить фильтры? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 27, 2021 Share Posted February 27, 2021 16 minutes ago, x11 said: Вы не поняли. Я имел ввиду обычный стандартный uniDBGrid. Как в него добавить фильтры? 1. UniDBGrid 2. function afterrender(sender, eOpts) { sender.addPlugin('gridfilters'); } 3. function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { columns[0].filter = {type: 'list'}; } Ext.grid.filters.filter.Boolean Ext.grid.filters.filter.Date Ext.grid.filters.filter.List Ext.grid.filters.filter.Number Ext.grid.filters.filter.String 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted February 27, 2021 Author Share Posted February 27, 2021 Попробую. Спасибо. Функционал с фильтрами очень удобный. Почему вы не хотите это добавить в стандартный функционал TuniDBGrid? Просто интересно. Quote Link to comment Share on other sites More sharing options...
Pier Posted February 28, 2021 Share Posted February 28, 2021 It seems to me that once filtering is applied the associated dataset does not scroll correctly. Can you confirm? (the afterscroll event is fired but but the row has not changed) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.