x11 Posted December 23, 2021 Share Posted December 23, 2021 Unfortunately, the developers have not created a convenient mobile mobile ListView for several years. We have to reinvent our new bicycle uniGui_Mob_XTamplate_Example.zip 1 Link to comment Share on other sites More sharing options...
picyka Posted December 23, 2021 Share Posted December 23, 2021 8 minutes ago, x11 said: Unfortunately, the developers have not created a convenient mobile mobile ListView for several years. We have to reinvent our new bicycle uniGui_Mob_XTamplate_Example.zip 153,43 kB · 0 downloads bicycle is good for health. Good Morning. 😃 Link to comment Share on other sites More sharing options...
Israel Portillo Posted December 23, 2021 Share Posted December 23, 2021 Awesome..... Thanks brother. Link to comment Share on other sites More sharing options...
55143681 Posted December 27, 2021 Share Posted December 27, 2021 thanks Link to comment Share on other sites More sharing options...
x11 Posted January 14, 2022 Author Share Posted January 14, 2022 @Sherzod не могли бы вы помочь со всплывающей подсказкой в XTemplate в данном примере? В js-файле (в папке \Win32\Debug\files\js\) есть функция getArc: function(val){ if (val[sender.fieldsNames.indexOf("DELETED")]){ return '<i style="color: red;" class="far fa-trash-alt"> </i>'} }, которая выводит иконку корзины, если запись помечена, как удаленная в архив. Так вот, подскажите, как сделать так, чтобы при нажатии на эту иконку корзины всплывала подсказка ToolTip? На форуме уже есть тема, в которой есть ваши примеры кода: function window.beforeInit(sender, config) { createToolTip = function(combo, tip) { combo.labelTip = Ext.create('Ext.tip.ToolTip', { closable: true, align: 'tl', focusOnToFront: true, autoHide: true, autoShow: true, autoScroll: true }); combo.labelElement.addListener('click', function(e) { e.preventDefault(); if (combo.labelTip) { if (combo.getPlaceholder()) { combo.labelTip.setHtml(combo.getPlaceholder()); } else { combo.labelTip.setHtml(tip); } combo.labelTip.showByTarget(combo.inputElement); } }); }; } но я не могу ваш код применить к этому примеру (ссылка на скачивание в первом сообщении этой темы) у меня появляются ошибки: Uncaught TypeError: Cannot read properties of undefined (reading 'addListener') Спасибо. Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2022 Share Posted January 14, 2022 Добрый день, Я попробую проанализировать. 1 Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2022 Share Posted January 14, 2022 39 minutes ago, x11 said: при нажатии Укажите пожалуйста иконку (на скриншоте). Link to comment Share on other sites More sharing options...
x11 Posted January 14, 2022 Author Share Posted January 14, 2022 В примере добавьте одну строку кода, в строку, например, 124 ( на главной форме Mainm) UniMainModule.FDMemTable1DELETED.Value := True и иконка появится (другими словами, укажите, что запись удадена в архив) Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2022 Share Posted January 14, 2022 3 minutes ago, x11 said: и иконка появится Ok. И, еще раз, какая подсказка должна выходить? Link to comment Share on other sites More sharing options...
x11 Posted January 14, 2022 Author Share Posted January 14, 2022 например, "Объявление №4 удалено в архив" Link to comment Share on other sites More sharing options...
x11 Posted January 15, 2022 Author Share Posted January 15, 2022 не получилось? Link to comment Share on other sites More sharing options...
Sherzod Posted January 15, 2022 Share Posted January 15, 2022 Нет ещё. 1 Link to comment Share on other sites More sharing options...
Sherzod Posted January 20, 2022 Share Posted January 20, 2022 On 1/15/2022 at 3:13 PM, x11 said: не получилось? Добрый день, Вы можете попробовать использовать следующий подход: function childtap(sender, location, eOpts) { if (location.sourceElement && location.sourceElement.className == 'far fa-trash-alt') { // custom logic } } Link to comment Share on other sites More sharing options...
x11 Posted January 20, 2022 Author Share Posted January 20, 2022 а куда этот код вставить? Link to comment Share on other sites More sharing options...
Sherzod Posted January 20, 2022 Share Posted January 20, 2022 Just now, x11 said: а куда этот код вставить? dbgResult -> ClientEvents -> ExtEvents -> Link to comment Share on other sites More sharing options...
Sherzod Posted January 20, 2022 Share Posted January 20, 2022 Пример: 1. function childtap(sender, location, eOpts) { if (location.sourceElement && location.sourceElement.className == 'far fa-trash-alt') { ajaxRequest(sender, "_tap", []) } } 2. procedure TMainmForm.dbgResultAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); const cEventNamePopup = 'eventPopup'; begin if EventName = '_tap' then begin ShowMessage(UniMainModule.FDMemTable1STREET_NAME.Value) end else if EventName = cEventNamePopup then begin fObjId := StrToIntDef(Params.Values['objId'], 0);// dbgResult.afterCreate.js fIdType := StrToIntDef(Params.Values['typeId'], 0); popupMnuRes.Show; end; end; Link to comment Share on other sites More sharing options...
x11 Posted January 20, 2022 Author Share Posted January 20, 2022 --- Link to comment Share on other sites More sharing options...
x11 Posted January 20, 2022 Author Share Posted January 20, 2022 1 minute ago, Sherzod said: if (location.sourceElement && location.sourceElement.className == 'far fa-trash-alt') { ajaxRequest(sender, "_tap", []) а если без участия сервера? не получится? т.е. в браузере показать Tooltip Link to comment Share on other sites More sharing options...
Sherzod Posted January 20, 2022 Share Posted January 20, 2022 1 minute ago, x11 said: а если без участия сервера? не получится? Можно конечно, но если честно, я этого избежал... 2 minutes ago, x11 said: т.е. в браузере показать Tooltip Можете хотя бы показать alert. Link to comment Share on other sites More sharing options...
Sherzod Posted January 20, 2022 Share Posted January 20, 2022 function childtap(sender, location, eOpts) { if (location.sourceElement && location.sourceElement.className == 'far fa-trash-alt') { //ajaxRequest(sender, "_tap", []) alert(location.record.data[12]); } } data: 0: 3 1: "APART" 2: 0 3: "USD" 4: true 5: 2 6: 2 7: 15 8: "" 9: "/files/img/nopicture100.png?20012022125058" 10: "" 11: "Region1/Region2" 12: "STREET2" 13: 140 14: 46 15: "" 16: "#000000" 17: 181 18: "32/20/12" 1 Link to comment Share on other sites More sharing options...
x11 Posted January 20, 2022 Author Share Posted January 20, 2022 8 minutes ago, Sherzod said: я этого избежал... очень сложно? Link to comment Share on other sites More sharing options...
Sherzod Posted January 20, 2022 Share Posted January 20, 2022 4 minutes ago, x11 said: очень сложно? Вы имеете в виду toolTip? Link to comment Share on other sites More sharing options...
x11 Posted January 20, 2022 Author Share Posted January 20, 2022 17 minutes ago, Sherzod said: Вы имеете в виду toolTip? да, взять уже готовый ваш код и применить здесь Link to comment Share on other sites More sharing options...
Sherzod Posted January 20, 2022 Share Posted January 20, 2022 4 minutes ago, x11 said: да, взять уже готовый ваш код и применить здесь Опять же попробую проанализировать. Link to comment Share on other sites More sharing options...
Sherzod Posted January 20, 2022 Share Posted January 20, 2022 9 hours ago, x11 said: взять уже готовый ваш код и применить здесь Думаю, в любом случае мы не можем применить готовый выше приведенный код, поскольку это не отдельный компонент, а иконка. Придется модифицировать код. Link to comment Share on other sites More sharing options...
Recommended Posts