Kos Posted May 23, 2022 Share Posted May 23, 2022 Доброе время суток. Подскажите, как добавить checkbox в заголовок колонки для checkAll \uncheckAll ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 23, 2022 Share Posted May 23, 2022 Добрый день, Quote Link to comment Share on other sites More sharing options...
Kos Posted May 23, 2022 Author Share Posted May 23, 2022 Ваш пример добавляет checkbox в панель(заголовок) грида, а не конкретной колонки. мне нужно именно в колонках как на картинке Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 23, 2022 Share Posted May 23, 2022 Я попробую проанализировать. Quote Link to comment Share on other sites More sharing options...
Kos Posted May 23, 2022 Author Share Posted May 23, 2022 нашел пример, но трудности прикрутить в UniGUI https://fiddle.sencha.com/#fiddle/158t&view/editor Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 23, 2022 Share Posted May 23, 2022 В процессе. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 23, 2022 Share Posted May 23, 2022 8 hours ago, Kos said: мне нужно именно в колонках как на картинке Добрый вечер, "Простая" реализация. 1. UniDBGrid1.ClientEvents.ExtEvents -> function viewready(sender, eOpts) { var column = sender.getColumns()[3]; column.setText('<input style="margin:0; vertical-align: text-top;" type="checkbox"> '+column.text+'</input>'); } 2. UniDBGrid1.ClientEvents.ExtEvents -> function headerclick(ct, column, e, t, eOpts) { //t - target if (typeof t.getAttribute === 'function' && t.getAttribute('type') === 'checkbox') { ajaxRequest(ct.grid, "checkboxChange", {dataIndex: column.dataIndex, checked: t.checked.toString()}) } } 3. UniDBGrid1.OnAjaxEvent -> procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'checkboxChange' then ShowMessage(Params.Values['dataIndex'] + ', ' + Params.Values['checked']) end; Скрины -> Quote Link to comment Share on other sites More sharing options...
Kos Posted May 23, 2022 Author Share Posted May 23, 2022 Супер! Огромное Спасибо! 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.