Sherzod Posted April 28, 2020 Share Posted April 28, 2020 Там просто есть понятие Родительский узел, идет группировка, в этом смысле где Вы будете хранить иконку для родительского узла? Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 28, 2020 Share Posted April 28, 2020 7 minutes ago, Sherzod said: Там просто есть понятие Родительский узел, идет группировка, в этом смысле где Вы будете хранить иконку для родительского узла? Иконки я храню в UniNativeImageList. Вопрос как добиться того, что я описал? Привязать иконку с конкретным номером к записи в БД, которая отображается. Если бы вместо индекса конкретной картинки можно было указать поле таблицы, в котором этот индекс хранится. Но такой возможности нет - не предусмотрено разработчиком. Ищу любые другие варианты это сделать. Но пока ничего в голову не приходит (( Quote Link to comment Share on other sites More sharing options...
x11 Posted April 28, 2020 Author Share Posted April 28, 2020 я вроде бы дал подсказку Quote Link to comment Share on other sites More sharing options...
stas Posted April 28, 2020 Share Posted April 28, 2020 1 minute ago, x11 said: я вроде бы дал подсказку Речь идет про UniTreeGrid имхо Quote Link to comment Share on other sites More sharing options...
x11 Posted April 28, 2020 Author Share Posted April 28, 2020 Ну принцип похожий. И там, и там столбцы грида. Создай столбец для иконок, там и рисуй. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 28, 2020 Share Posted April 28, 2020 55 minutes ago, dbf_usr said: Ищу любые другие варианты это сделать. Но пока ничего в голову не приходит (( Я еще раз попробую проанализировать. Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted April 28, 2020 Share Posted April 28, 2020 12 minutes ago, Sherzod said: Я еще раз попробую проанализировать. За ранее благодарен!!!! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 28, 2020 Share Posted April 28, 2020 1 hour ago, dbf_usr said: Ищу любые другие варианты это сделать. Quote Link to comment Share on other sites More sharing options...
stas Posted April 28, 2020 Share Posted April 28, 2020 Шерзод, я честно не понимаю, если тут "ехать, а не шашечки" почему не использовать банальный OnGetText у поля и не выеживаться, я бы делал исключительно так и не ждал никого. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 28, 2020 Share Posted April 28, 2020 Да, хотя тоже вариант. Quote Link to comment Share on other sites More sharing options...
stas Posted April 28, 2020 Share Posted April 28, 2020 5 minutes ago, Sherzod said: Да, хотя тоже вариант. Делается ShowIcon false, и рисуется хоть дивизия Буденного у постели Горького. З.Ы. Кстати такой интересный вопрос Вы Server Farms пытались использовать ? У меня не получилось, я знаю, почему, но как это обойти. Quote Link to comment Share on other sites More sharing options...
x11 Posted April 29, 2020 Author Share Posted April 29, 2020 13 hours ago, Sherzod said: Ну, и как это сделать? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 29, 2020 Share Posted April 29, 2020 2 minutes ago, x11 said: Ну, и как это сделать? 1. procedure TMainForm.UniFormCreate(Sender: TObject); begin with ClientDataSet1 do begin Append; FieldByName('ID').AsInteger := 1; FieldByName('ParentID').AsInteger := 0; FieldByName('itemName').AsString := 'Japan'; FieldByName('iconName').AsString := 'fa fa-home'; Post; Append; FieldByName('ID').AsInteger := 2; FieldByName('ParentID').AsInteger := 1; FieldByName('itemName').AsString := 'Tokyo'; FieldByName('iconName').AsString := 'fa fa-plus'; Post; end; end; 2. UniDBGrid1 Settings: IdField = ID IdParentField = ParentId Columns: itemName, iconName ClientEvents.ExtEvents: function store.nodeappend function store.nodeappend(sender, node, index, eOpts) { if (node.data) { node.data[0] = '<span class="'+ node.data[1] +'"> </span>' + node.data[0] } } Quote Link to comment Share on other sites More sharing options...
x11 Posted April 29, 2020 Author Share Posted April 29, 2020 О, я забыл же. У меня же так и сделано. Есть текстовый calculated-столбец в TDataSet и я туда пишу название иконки procedure TfmdMainForm.DataSet1CalcFields(DataSet: TDataSet); begin DataSet.FieldByName('img').AsString := ''; if DataSet.FieldByName('old_price').asinteger > 0 then begin if DataSet.FieldByName('old_price').asinteger > DataSet.FieldByName('price').asinteger then DataSet.FieldByName('img').AsString := '<i class="fa fa-arrow-down" aria-hidden="true"></i>'; if DataSet.FieldByName('old_price').asinteger < DataSet.FieldByName('price').asinteger then DataSet.FieldByName('img').AsString := '<i class="fa fa-arrow-up" aria-hidden="true"></i>'; end// if DataSet.FieldByName('old_price').asinteger > 0 else begin if DataSet.FieldByName('IsNewObj').asinteger = 1 then DataSet.FieldByName('img').AsString := '<i class="fa fa-asterisk" aria-hidden="true"></i>'; end; end; Только нужно писать в столбец не "fa fa-plus", а полный HTML-код s := '<i class="fa fa-arrow-down" aria-hidden="true"></i>' как указано здесь https://fontawesome.com/v4.7.0/icon/address-book Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted May 2, 2020 Share Posted May 2, 2020 Sherzod x11 Спасибо !!!! Пробую ))) Quote Link to comment Share on other sites More sharing options...
x11 Posted December 19, 2020 Author Share Posted December 19, 2020 On 4/27/2020 at 9:52 PM, Sherzod said: Спасибо. Мы проанализируем и постараемся исправить. до сих пор не исправили 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.