maher Posted May 21, 2023 Share Posted May 21, 2023 Hello, 1 - We use this code to Expand /Collapse Raw Widget while not qrySrv.Eof do begin with grdSrv, JSInterface do begin JSCall('getPlugin().toggleRow',[qrySrv.RecNo-1, JSStatement(JSName+'.getStore().data.items['+IntToStr(qrySrv.RecNo-1)+']')]) end; qrySrv.Next; end; But this code will Expand a collapsed row and Collapse expanded row !!! How I can Expand all rows / Collapse all rows , I mean how I can check the if the row is Expanded/Collapsed Like while not qrySrv.Eof do begin with grdSrv, JSInterface do begin if (RowIsExpand and OpIsCollapse***) or (RowIsCollapse and OpIsExpand***) then JSCall('getPlugin().toggleRow',[qrySrv.RecNo-1, JSStatement(JSName+'.getStore().data.items['+IntToStr(qrySrv.RecNo-1)+']')]) end; qrySrv.Next; end; TAHNX Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 21, 2023 Share Posted May 21, 2023 Hello, For some of your questions, should be answers on the forum. Have you tried searching? Quote Link to comment Share on other sites More sharing options...
maher Posted May 22, 2023 Author Share Posted May 22, 2023 Hello, I tried to search the forum but did not find an answer to above question. Thank you, Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 22, 2023 Share Posted May 22, 2023 Okay, you need to analyze toggleRow method. I will also try to check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 22, 2023 Share Posted May 22, 2023 Try to analyze and use this code. procedure TMainForm.UniButton1Click(Sender: TObject); begin with UniDBGrid1, UniDBGrid1.JSInterface do JSCode('if ('+ JSName +'.getPlugin("rowWidget").recordsExpanded['+ DataSource.DataSet.RecNo.ToString +']) {'+ JSName +'.getPlugin("rowWidget").toggleRow('+ (DataSource.DataSet.RecNo-1).ToString +', '+ JSName +'.getStore().data.items['+ (DataSource.DataSet.RecNo-1).ToString +'])};') end; Quote Link to comment Share on other sites More sharing options...
maher Posted May 23, 2023 Author Share Posted May 23, 2023 Thank you... I will try. Quote Link to comment Share on other sites More sharing options...
maher Posted May 23, 2023 Author Share Posted May 23, 2023 Hello, I tried it but i got error : Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 23, 2023 Share Posted May 23, 2023 Hello, 1 hour ago, maher said: I tried it but i got error : Don't know. I couldn't reproduce. procedure TMainForm.UniButton1Click(Sender: TObject); begin with UniDBGrid1, UniDBGrid1.JSInterface do begin DataSource.DataSet.First; while not DataSource.DataSet.Eof do begin JSCode('if ('+ JSName +'.getPlugin("rowWidget").recordsExpanded['+ DataSource.DataSet.RecNo.ToString +']) {'+ JSName +'.getPlugin("rowWidget").toggleRow('+ (DataSource.DataSet.RecNo-1).ToString +', '+ JSName +'.getStore().data.items['+ (DataSource.DataSet.RecNo-1).ToString +'])};'); DataSource.DataSet.Next; end; end; end; Quote Link to comment Share on other sites More sharing options...
maher Posted May 24, 2023 Author Share Posted May 24, 2023 Hello... with UniDBGrid1, UniDBGrid1.JSInterface do begin DataSource.DataSet.First; while not DataSource.DataSet.Eof do begin JSCode('if ('+ JSName +'.findPlugin("rowwidget").recordsExpanded['+ DataSource.DataSet.RecNo.ToString +']) {'+ JSName +'.findPlugin("rowwidget").toggleRow('+ (DataSource.DataSet.RecNo-1).ToString +', '+ JSName +'.getStore().data.items['+ (DataSource.DataSet.RecNo-1).ToString +'])};'); DataSource.DataSet.Next; end; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 24, 2023 Share Posted May 24, 2023 And? Quote Link to comment Share on other sites More sharing options...
maher Posted May 24, 2023 Author Share Posted May 24, 2023 Hello... Finally it works..... used findPlugin not getPlugin Thank you. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 24, 2023 Share Posted May 24, 2023 Hmm, Which build of uniGUI are you using? Quote Link to comment Share on other sites More sharing options...
maher Posted May 24, 2023 Author Share Posted May 24, 2023 Hello... 1.90.0.1551 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.