PDA

View Full Version : removeItemAt(0) when 6 items added


stonyx
09-02-2006, 07:03 PM
hello i think this is something easy but don't know how to do it

what i am trying to do is to remove an item in a datagrid (_xlcdatagrid2) after there's 5 items in it

this is the code for doing it with a button.
public function removeItem():void
{
_xlcdatagrid2.removeItemAt(0);
}

so far this works but don't know what to use so it will delete the first row after a 6t row is added

stonyx
09-03-2006, 07:15 PM
i just try this but it does not work
any ideas

public function AutoB():void{
if (this._xlcdatagrid2.length > 2){
_xlcdatagrid2.removeItemAt(0);
}
}

Tink
09-03-2006, 10:39 PM
DO NOT DUPLICATE YOUR POSTS. You have been here long enough to know that its frowned upon.

where'd ta get removeItemAt() from, i don't see in it in the documentation?

Just remove the item from you dataprovider and re-assign the data.

stonyx
09-04-2006, 03:27 PM
sorry won't happen again but i was desperate LOL
i'll continue posting in the other one :)

senocular
09-04-2006, 03:29 PM
http://www.actionscript.org/forums/showthread.php3?t=115777