Alexander Muromsky Posted June 22, 2018 Share Posted June 22, 2018 Добрый день. Необходимо при выборе строк в unimDBGrid выделять их другим цветом (менять цвет фона и текста). На форуме по данному вопросу ничего не нашел. Версия UniGUI: Complete Professional 1.10.0.1457 Спасибо. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 22, 2018 Share Posted June 22, 2018 Добрый день, Этот пост может Вам помочь: http://forums.unigui.com/index.php?/topic/6931-unimdbgrid-selected-row-color/&do=findComment&comment=35280 Quote Link to comment Share on other sites More sharing options...
Alexander Muromsky Posted June 25, 2018 Author Share Posted June 25, 2018 Спасибо! Но это немного не то... Мне необходимо что-бы при первом нажатии на строку цвет фона запоминался, а при повторном нажатии становился тем , который был по умолчанию. Если в beforeInit прописываю config.itemCls = '_x-item-selected'; то все строки закрашиваются и и никакого эффекта нет при выборе нужной строки: function beforeInit(sender, config){ var SelRowType = document.getElementsByName('LineChk')[0]; if (SelRowType == "ДА"){ config.itemCls = '_x-item-selected'; } else { config.itemCls = '_x-item-unselected'; }} Quote Link to comment Share on other sites More sharing options...
Alexander Muromsky Posted June 25, 2018 Author Share Posted June 25, 2018 То-есть необходимо в зависимости от значения поля менять цвет всей строки. Например: Если значение = 0 , то использовать цвет установленный по умолчанию в unimDBGrid. Если значение = 1 , то зеленый. Если значение = 2 , то красный. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 25, 2018 Share Posted June 25, 2018 Добрый день, Может этот пример Вам стоит посмотреть ?: \FMSoft\Framework\uniGUI\Demos\Touch\DBGrid - DrawColumnCell Quote Link to comment Share on other sites More sharing options...
Alexander Muromsky Posted June 25, 2018 Author Share Posted June 25, 2018 Добрый день, Может этот пример Вам стоит посмотреть ?: \FMSoft\Framework\uniGUI\Demos\Touch\DBGrid - DrawColumnCell По данному пути в версии 1457 пример отсутствует ((( Я сначала просмотрел все примеры как для Desktop так и Touch, но ничего похожего там нет. Мне это необходимо сделать в мобильной версии... Quote Link to comment Share on other sites More sharing options...
Alexander Muromsky Posted June 25, 2018 Author Share Posted June 25, 2018 Вот здесь нашел вариант: http://skirtlesden.com/articles/styling-extjs-grid-cells --> Styling Rows Но как это переложить для использования в данной версии uniGUI под ExtJS 6.5 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 25, 2018 Share Posted June 25, 2018 По данному пути в версии 1457 пример отсутствует ((( Я сначала просмотрел все примеры как для Desktop так и Touch, но ничего похожего там нет. Мне это необходимо сделать в мобильной версии... Попробуйте обновиться до последней версии... http://forums.unigui.com/index.php?/topic/10516-unigui-1100/page-2&do=findComment&comment=55982 Quote Link to comment Share on other sites More sharing options...
Alexander Muromsky Posted June 25, 2018 Author Share Posted June 25, 2018 Спасибо!!! Всё получилось!!! Quote Link to comment Share on other sites More sharing options...
Ruslan Posted July 9, 2018 Share Posted July 9, 2018 Спасибо!!! Всё получилось!!! можно пример как в итоге сделали? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 10, 2018 Share Posted July 10, 2018 Здравствуйте, можно пример как в итоге сделали? Может этот пример Вам стоит посмотреть ?: \FMSoft\Framework\uniGUI\Demos\Touch\DBGrid - DrawColumnCell Quote Link to comment Share on other sites More sharing options...
Alexander Muromsky Posted July 10, 2018 Author Share Posted July 10, 2018 Добрый день! Конечно можно.... procedure TMyForm.UnimDBGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TunimDBGridColumn; Attribs: TUniCellAttribs); begin if ds.FieldByName('AGE').AsInteger > 18 then Attribs.Color := $DFFFDF else Attribs.Color := $DFDFFF; if ds.FieldByName('AGE').AsInteger = 25 then Attribs.Font.Style := [fsBold] else Attribs.Font.Style := []; if ((Column.FieldName = 'FIO') and (ds.FieldByName('FIO').AsString = 'Иванов Иван Иванович')) then Attribs.Font.Color := clRed; end; 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.