i did bubble sort and then i just coded get value for every item in the list then when i run it, then it is not coming in an order, the last item in the list is coming in the first. pls help!!



i did bubble sort and then i just coded get value for every item in the list then when i run it, then it is not coming in an order, the last item in the list is coming in the first. pls help!!
You can use sorting extension or js extension to sort the list or arrays Need list sorter extension - #3 by Still-learning
Or you can try this js method of sorting Correct number order in dictionary - #6 by Still-learning.
Or call the firebase from project ucket it self then segemnt each tav value into list order
Don’t use , call th list then get value method
Call the tag DEPOSITS, sort the result using js then from sorted string parse the values into list then create dynamic view
i didn’t understood, could you please explain by code
Go to fb, export that project bucket as json and upload here… i will try
My firebase structure
Before sorting
After sorting
Total block
JS code to sort alphanumeric
[_Your_tags_key_should_go_here_].sort((a, b) => a.localeCompare(b, 'en', { numeric: true })).toString()
App response
Got the point now @Gaming ?
Expected like this?
credit to @juananton1991
Sure! I’d be happy to help you with your problem involving a tag list, bubble sort, Firebase, and dynamic card view in Kodular. Here is an example of how you might approach this problem:
// Declare a list of values to sort
list values = ["apple", "banana", "cherry", "date"]
// Implement the bubble sort algorithm
for i from 0 to length(values) - 2
for j from 0 to length(values) - i - 2
if values[j] > values[j + 1]
swap values[j] and values[j + 1]
// Print the sorted list to the console
for value in values
console.log(value)
// Save data to Firebase
firebase.setValue("/users/user1/name", "John")
firebase.setValue("/users/user1/age", 30)
// Retrieve data from Firebase
firebase.getValue("/users/user1/name", function(name) {
console.log("Name: " + name)
})
firebase.getValue("/users/user1/age", function(age) {
console.log("Age: " + age)
})
// Declare a list of card titles
list titles = ["Card 1", "Card 2", "Card 3"]
// Use a for loop to create a card for each title
for title in titles
// Add a Card View component
cardView = new CardView(verticalArrangement)
// Set the card's title
cardView.Title(title)
// Add other content to the card, such as an image or text
image = new Image(cardView)
image.Picture("https://example.com/image.jpg")
I hope this example helps you to solve your problem! If you have any more questions or need further assistance, don’t hesitate to ask.
actually i am new to kodular, so i didn’t understood this complicated code but i am using bubble sort for sorting isn’t it ok?
If it works then no issue… just run for it.