Open jitre opened 1 year ago
Just use listView.items[].button1
and listView.items[].form1
to realize your expected operation π, and thanks for reporting this, it seems that we should update our doc right now.
Just use
listView.items[].button1
andlistView.items[].form1
to realize your expected operation π, and thanks for reporting this, it seems that we should update our doc right now.
Thank you very much for your help, it has been very helpful. I still have one question: I know that I can access a specific item in the list by index, but how do I know which index corresponds to the item that is currently being clicked? @lmx1117
Thank you very much for your help, it has been very helpful. I still have one question: I know that I can access a specific item in the list by index, but how do I know which index corresponds to the item that is currently being clicked? @lmx1117
Because I do not know your specific use scenario, you can just take a look at these two demos, for example, I want to display the title value of a listview item after clicking the button (p1), it can be achieved through {{currentItem.title}}, if you want to run a query, you can refer to p2 for passing parameters
@lmx1117 Thank you very much. I solved it using temporary state.
I have a related question: I have a dropdown (Select) in a List View. Upon change I run some Javascript code and would then like to clear the value of the dropdown. However, I get this error: "Nnotas.items[currentIndex].Nbijlagen.clearValue is not a function". The functions of a specific element in a List View are not accessible, are they?
I have a related question: I have a dropdown (Select) in a List View. Upon change I run some Javascript code and would then like to clear the value of the dropdown. However, I get this error: "Nnotas.items[currentIndex].Nbijlagen.clearValue is not a function". The functions of a specific element in a List View are not accessible, are they?
May I have a look at the JS code that runs on the change of your Select component?
Sure.
if(Nnotas.items[currentIndex].Nbijlagen.value != "") { let w = window.open(/*some url*/); w.document.write(/*some string*/); Nnotas.items[currentIndex].Nbijlagen.clearValue(""); }
With:
Note: The statements inside the if runs, so Nnotas.items[currentIndex].Nbijlagen.value exists (the value is correctly reused in a string in the if as well).
The final statement fails, with: clearValue is not a function.
@SvV-CWinJS Sorry for the inconvenience, for now, you cannot access the components' function in listView, itβs something with listView itself, and it should be refined in the first release in April
@lmx1117 hello Can I access the current actual content of an input element inside a list view
It seems unable to obtain the current changed value of the input element, list.items[i].input.value.
I too experience what jitre writes. (under version 1.1.7) Accessing an input element's data (when in a list view) gives you its default value, not the "live" content. This is also true when the input element is part of a form (when the form is again in a list view).
JSON attached to clarify. test ListView2.json.txt
I too experience what jitre writes. (under version 1.1.7) Accessing an input element's data (when in a list view) gives you its default value, not the "live" content. This is also true when the input element is part of a form (when the form is again in a list view).
JSON attached to clarify. test ListView2.json.txt
I have discovered a way to obtain the dynamic values of input elements within a ListView. If the data in the ListView does not contain this field, the input elements can be modified and their values can be obtained. However, if this field exists, it will be set to read-only.
Thanks for reporting this I will check with the engineer and come back to you later.
@jitre @SvV-CWinJS Confirmed that this is a bug, thank you for your proposal, and I will let you know after fixing it.
I created a collection of elements using ListView, as shown in the figure below. However, I found that there is no way to determine which element is currently being clicked, and the form components inside ListView cannot store and extract fields for specific elements, making it impossible to develop functions based on specific elements, such as liking.