[flexcoders] Re: Any DataGrid paging component?

2008-10-06 Thread crazyluck55
One other note, I changed my example from a TileList to a Datagrid at 
the last moment (since you specifically asked about that) without 
changing its properties appropriately.  Substitute as necessary.



[flexcoders] Re: Any DataGrid paging component?

2008-10-03 Thread crazyluck55
Hi Oneworld95,

While I don't know of a canned paging DataGrid component, putting one 
together is straightforward enough.  The following example will page 
through subsets of an already populated collection.

You want to start by creating a custom component that binds to the 
source data provider (ie:ArrayCollection, etc).  Give the component 
an attribute that allows you to specify the number of items per 
page.  Also create a pageData:Array property that you bind to the 
datagrid you wish to page through.

So your custom pager control might look something like this:

control:Pager id=myPager
pageSize=6
collection={_model.selectedType.myItems}
index = 0/

... and you would invoke it thusly:

mx:DataGrid
columnCount = 3
rowCount = 2
dataProvider = {myPager.pageData} 

Be sure to give the control hasPrev and hasNext boolean properties so 
you can bind to your paging buttons appropriately (maybe even set 
the 'visible' flag of your buttons based on them).  When one of the 
buttons are clicked, dispatch an event to cue the control to flag the 
next 6 or previous 6 data items as the subset of the 'collection' 
that are being returned as the 'pageData'.

There's always a handful of housekeeping chores to keep in mind with 
such custom controls, such as a label to indicate to the user that 
they are presently at 'Page 5 of 12'; and tracking to make sure they 
don't page beyond the data (to be really slick, have the array roll 
back around to the top of the collection if they should do so).

It's also possible to create such a paging arrangement that will call 
to the server for a new page of information every time the previous 
or next button is clicked, but that is quite a bit more complicated 
and probably counterproductive.  Any array small enough that people 
would willingly page through is probably no more than a few hundred 
items.  It would not be a strain on local system resources to 
download and store the array all in one hit, as opposed to calling to 
the server over and over again with each click of the 'next' button.

And of course, if you spend an afternoon coding this once, you'll 
have it forever.  A worthy expenditure of time, imo.

Hope this was useful,
John Mattaboni



[flexcoders] Keyboard macros or bindings for Eclipse?

2008-06-25 Thread crazyluck55
I would like to tap the F1 key and have the mx: prefix automatically 
spit out in the Eclipse editor (I'm using Flex if that matters).

All I can find is information on how to re-assign existing commands 
(like Paste) to different keystrokes but nothing about macroing a few 
kestrokes to a particular key.

Any help?



[flexcoders] Re: book errata

2008-06-11 Thread crazyluck55
Where on the Peachpit site would it be?  I can see the book but nothing 
about an errata sheet.  I'm looking here:

http://www.peachpit.com/store/product.aspx?isbn=0321529189