rgreat Posted March 26, 2018 Share Posted March 26, 2018 If you add items at design time it working. But at runtime you get error: UniCheckListBox1.Items.Add('Test 1'); Failed to execute 'querySelectorAll' on 'Element': 'input[type=checkbox]:nth(1)' is not a valid selector.O40.insert(0,{id:"0",val:"Test 1"});O3C.boundList.refresh();O3C.el.select("input[type=checkbox]:nth(1)").elements[0].disabled=0;_sfv_(O3C,0,""); Project attached. http://www.rgreat.ru/tmp/Delphi/sgtest.exe- compiled file. sgtest.zip Quote Link to comment Share on other sites More sharing options...
arilotta Posted March 27, 2018 Author Share Posted March 27, 2018 rgreat, I've added the "margin-left: 0px; margin-top: 0px;", in fact it looks nicer. If I understand correctly, you are trying to use the component with the Beta version, running on Ext JS 6.5. Unfortunately, at the moment I've not installed that version, so I cannot help you. Maybe someone else on the forum can help you to fix the issues.... Quote Link to comment Share on other sites More sharing options...
rgreat Posted March 27, 2018 Share Posted March 27, 2018 Quote Link to comment Share on other sites More sharing options...
rgreat Posted March 27, 2018 Share Posted March 27, 2018 Fix for ExtJS 6.5.3: Unichecklst.pas procedure TUniCheckListBox.SynchronizeJSCheck(Index: integer); var i: integer; begin for i:=IfThen(Index=-1, 0, Index) to IfThen(Index=-1, Count-1, Index) do // nth(n) (1 based) JSInterface.JSCode(#1'.el.select("input[type=checkbox]").elements['+i.ToString+'].checked='+Selected[i].ToString.ToLower+';'); end; procedure TUniCheckListBox.SetReadOnly(Value: Boolean); var i: integer; begin // Problem if Items set to design-time and ReadOnly set to TRUE, because it has not yet digested the WebCreate if Value<>FReadOnly then begin FReadOnly:=Value; if not (csDesigning in ComponentState) then for i:=0 to Count-1 do // nth(n) (1 based) JSInterface.JSCode(#1'.el.select("input[type=checkbox]").elements['+i.ToString+'].disabled='+FReadOnly.ToString.ToLower+';'); end; end; I think it will work in old versions too. Quote Link to comment Share on other sites More sharing options...
arilotta Posted March 28, 2018 Author Share Posted March 28, 2018 Great job rgreat, your solution is compatible with the current official release based on EXT JS 4.2.5, so I kept it. For those interested, I attach the updated compenent source. Unichecklst.zip Quote Link to comment Share on other sites More sharing options...
Wilton Ergon Posted April 9, 2018 Share Posted April 9, 2018 ola, estou usando seu componente, mas me deparei com um problema ao definir as propriedades selecionadas com a meta visível: = false, ele gera um erro. [/ size] put a component, set visible :=false; for I := 0 to (cList.Items.Count - 1) do begin cList.Selected:=True; 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.