x11 Posted May 11, 2020 Posted May 11, 2020 Разворачивавются (раскрываются) не все пункты меню procedure TfmdMainForm.actMenuExpandExecute(Sender: TObject); begin // в UniTreeMainMenu.Tag хранится флаг состояния меню - развернуто оно или свернуто, чтобы разворачивать и сворачивать можно было одной кнопкой. if UniTreeMainMenu.Tag = 0 then begin UniTreeMainMenu.JSInterface.JSCode(#1'.getStore().data.items.forEach(function(el){el.expand()});'); UniTreeMainMenu.Tag := 1; end else begin UniTreeMainMenu.JSInterface.JSCode(#1'.getStore().data.items.forEach(function(el){el.collapse()});'); UniTreeMainMenu.Tag := 0; end; end; Назначение родительских пунктов меню в процедуре: procedure TfmdMainForm.BuildMainMenu; begin mmMain11.SetParentComponent(mmMain1); mmMain12.SetParentComponent(mmMain1); mmMain21.SetParentComponent(mmMain2); mmMain22.SetParentComponent(mmMain2); mmMain31.SetParentComponent(mmMain3); mmMain32.SetParentComponent(mmMain3); mmMain41.SetParentComponent(mmMain4); mmMain42.SetParentComponent(mmMain4); mmMain51.SetParentComponent(mmMain5); mmMain52.SetParentComponent(mmMain5); end; Как сделать, чтобы разворачивались/сворачччивались все пункты меню? Спасибо. UniGUI 1530. unigui_event.zip Quote
Sherzod Posted May 11, 2020 Posted May 11, 2020 2 hours ago, x11 said: UniTreeMainMenu.JSInterface.JSCode(#1'.getStore().data.items.forEach(function(el){el.expand()});'); Попробуйте с defer: UniTreeMenu1.JSInterface.JSCode(#1'.getStore().data.items.forEach(function(el){Ext.defer(function(){el.expand()}, 50)});'); 1 Quote
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.