Hi guys, It's been a while… trying to pass the time in these troublesome times, I decided to restart a few projects, and got back into development. I have an Huawei P20 and a very simple layout consisting of a "Title" panel (with a label, a textfield, 2 checkboxes and a button) and a...
oparra, thanks for the link!
Alas, loading 1000 records takes more than 5 seconds. This option doesn't work for me.
With PreoptimizedCLV, loading times are short, and there is no way to set the height of expandable rows.
Are you saying you want to display items under any given panel when expanded, then auto close it when another panel is clicked. See image below. If that is the case I can upload a B4J project to illustrate that to give you ideas for your real project, using Lazy Loading in xCLV ( not PCLV which not essential as Erel said). If you are thinking differently, then wait till someone else tackles your problem.
I want that in my example, for each record, it would be possible to display several elements in height in the drop-down field (for example, Label). Their number depends on the parent row.
I have created a B4J project based on yours with 10000 records and takes 10 ms to load all. It has PCLV and lazy loading. I also added a list of items where each list item is loaded onto a label to make the child views for each panel clicked. I am using the same list for each record. When you click a panel title, the pane expands and displays the 11 items in the list. See screenshot. It needs some tweaking. Other than that it works. If you want to play with it, I can post it. If not, good luck.
Here it is. I hope it helps some. If you improve it, which you certainly will, share the code with the rest. If it does not help, just toss it. If you ask and I do not answer, then it means I have no answer and someone else may possibly help.
Maharis, thank you so much!
An example is almost what I needed. I explain:
Imagine that Item #1, Item #2, and so on, are the owners of the animals on your list. Each of them may be different. One has only a dog, another has a cat, the third has everything. So I want to see what animals each owner has?
Maharis, thank you so much!
An example is almost what I needed. I explain:
Imagine that Item #1, Item #2, and so on, are the owners of the animals on your list. Each of them may be different. One has only a dog, another has a cat, the third has everything. So I want to see what animals each owner has?
Just somethink real quick. Of course to do it the proper way is to have a database table that you extract the distinct owners and use a query to select each owner's animals from another query. Requires a little work on your part.
B4X:
Private DataMain As List 'in globals , use DataMain instead of Data
Add these few lines to the top of Private Sub clv1_VisibleRangeC
B4X:
Private Sub clv1_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
Dim Data As List
Data.Initialize
Dim x As Int = Rnd(0, DataMain.Size) 'use a different number of animals for every title.
For k=x To DataMain.Size-1
Data.Add(DataMain.Get(k))
Next
Hi everyone I congratulate @Erel for the PreoptimizedCLV library. It has an excellent performance. Does anyone know if it is possible to resize an item containing a variable height label? Could CLV.ResizeItem() be used? Does anyone have an example? Thanks
I have read this before. Mahares offered to help with a possible solution.
I have already spoken about the need to change the height of the expanded panel.
Well @oparra clarified it for you. If you are really serious about building an app that uses xCLV with CLVExpandable, lazy loading and do all you want done with it, you really need a bonafide database that has all the necessary columns to make it work, not just having data coming from: For i=0 to 10000. You are not going to give it justice by using a 0 to 10000 loop that is very abstract.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.