How to display selected items in list component? - actionscript-3

I have a Array Collection which contains around 10 items and i have assigned this arraycollection to list component as dataprovider. Is there anyway that i can display only the first 5 items in the list component without removing remaining 5 items from array collection.

You can wrap the ArrayCollection in another ArrayCollection and then apply a filter function to the first one. That way, your original collection will not be affected by the filter.

Related

How to show droppable area using Drag and Drop HTML API

I'm implementing a functionality where the user can sort the list and re-order the elements, on dragover I want to show the droppable area below the dragover element.
Note: I want to achieve this using native javascript
Without seeing your code I can't suggest an exact implementation but you can use JS to inject a "placeholder" element.
First, you'll need to know the position of all your items, maybe use an array to log the order of your list items.
Next, on dragover append the placeholder element in the place of where the dragged item you are moving is located on the list. For example, if you have a list like:
ITEM 1
ITEM 2
ITEM 3
ITEM 4
When you drag ITEM 4 over ITEM 3 then inject the placeholder after ITEM 2 so it appears between ITEM 2 and 3. When you drop ITEM 3, you can remove the placeholder.
Note, you'll also have to remove the injected placeholder as you move further up/down the list. Otherwise, you'll end up with multiple placeholders.
There are also plugins available for this such as HTML5 Sortable and SortableJS

Multiple dataprovider for itemrender in DataGrid ActionScript 3

I have a DataGrid. I'm using combobox in Grid as ItemRender. I want to set dataprovider for item in each row which using combobox. Each row at item which using combobox have different dataprovider. I'm using Flex 3.
The ComboBox dataProviders for each row must be embedded in the dataProvider for the whole Grid, and you can retrieve them selectively in the itemRenderer.

Polymer 1.0 dom-repeat with filter: action on visible items?

I have a dom-repeat with a dynamic filter depending on a paper-input value.
I need to apply an action to only the visible items, in other words only to those items passing the filter function (returning true)
Within that action function, how can I know which item is visible and which is not?
p.s. Looping the items array won't tell anything because the filter doesn't alter the items array. I am guessing there might be a way of looping the associated dom checking for some property or class, or otherwise.
Thanks in advance

add a row to a datagrid where a user can input data in as3

what i am trying to achieve is to have data populate a datagrid from a query, this part works fine. but once the data has been populated i want to add an additional row which the user will be able to type into. so for example the grid will have 5 pre populated rows and then the 6th row will be empty cells which the user can edit. the final column of this row will either be a button or an image with the click property set. this will be used to run an update query to update the dataprovider of the datagrid.
This is pretty easy. Just add a new object in your List that is bound to the datagrid. For the final column you will need an item renderer.
Ex:
dataGrid.dataProvider = someList;
//later when it is populated
someList.addItem(new Item());
After this you can set the focus to the desired column and the last row to show its input time.
You can also remove the last added item from the list to simulate a cancel action.
You will also need to set the 'editable' property of the grid to true. Set the selectionMode property to 'singleRow' Each column also has an individual 'editable' property so you can limit users to only changing certain properties.
As long as the data is simple text the default item editor (which is a textInput) will work fine. If you use an advancedDataGrid you can also include things like checkBoxes for Boolean data.

birt detail row divide into two columns

Hi i have a report that has many details, I need to divide it into 2 columns. The usual detail row gets enumerated going down like this:
List item
List item
List item
List item
but i want it to look like this
List item 3. List item
List item 4. List item
How do I do that? Is there a sample / link where I can refer to? I was thinking maybe thre is an easier way like a control to add than programming it to divide itself. I cant just divide it by fixed no. coz detail for each category has different counts.
thanks
the "List" element from the BIRT palette should act exactly as you need:
Drag a list from the palette onto the body of the report
Bind the list to the data set in "bindings" tab
Drag & drop a field from the dataset within the list details
Set the width of this field as you like, for example something like half-width of a page
In general properties of the datafield, set property "display" to "inline". Run the report, your items will be split in 2 columns
If you want to combine several datafields in each column:
insert a grid element in list details, and set its width as required
In general properties of the grid, set property "display" to "inline"
Arrange datafields as you like in the grid