rowData = [];
alert(rowData[0]);
gives me [Ti.UI.TableViewRow]
Now how can i remove this element… i have been using rowData.splice(), but i have no idea on what to pass to remove it.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the code you present
rowDatashould be empty, sorowData[0]should beundefined. I suppose something is pushed torowDatain between? Anyway, there are several ways to remove elements from arrays:from an array using
rowData.length =.0
the
Array.splicemethod. E.g.removing the first element:
rowData.splice(0,1)(means remove1 element of rowData starting from
element 0 (the first element).
want to remove you could also use the
shiftmethod:rowData.shift().slice:rowData = rowData.slice(1)(means: give me all elements from
rowData starting at the first element and
assign the result to
rowData),or
rowData.slice(1,4)(means:give me all elements from
rowData starting at the first element,
ending at the fourth element, and
assign the result to
rowData).