I would like to add a custom button (checked/unchecked) to each row of the UITableView. Should I use UITableViewCell for this purpose?
Also, if I want the same look and feel for each UITableViewCell, should I create multiple cells and apply the same properties to each cell or is there any trick to repeat the process?
I will be using IB for this purpose.
Thanks,
Amy (Novice)
I strongly recommend that you have a look at the TableViewSuite sample project. It has a lot of useful example information for configuring UITableViews, including an example of subclassing UITableViewCell. Here's a link:
http://developer.apple.com/iphone/library/samplecode/TableViewSuite/index.html
Related
I have a ListEditor called OperatorListEditor. There I create a table with 5 Linkbuttons. Each button has different actions. How can I access them from OperatorViewController and how should I get them from ProcessAction ?
Or maybe I can create these buttons in OperatorViewController?
Should I create 5 callbacks? And if it's what should I do, how?
Explain with more details, please. I'm a noob
For a more XAF-Friendly approach, you should write 5 simple actions on the OperatorViewController, instead of creating linkbuttons on a custom ListEditor.
To move your action from toolbar to inline, set the action's SelectionDependencyType - to RequireSingleObject and Category to RecordEdit, this will create a GridViewDataActionColumn in runtime. There are serveral examples in Support Center about how to customize a GridViewDataActionColumn as needed.
See also:
https://documentation.devexpress.com/#Xaf/CustomDocument2737
Just out of curiosity, I am making an effort to optimize every part of our flex app (which is a small part of our app in general). Currently, I am working on optimizing all of the buttons/skins. I have linked a few of the buttons that I use, and some sample code I am using to generate them.
Please advise on how to make this more efficient, usable, and just better overall. Thanks!
As you can see, our buttons can be pretty different, but have a similar look and feel. Currently, I am creating 'stateful skins,' by setting up something like this:
skin: ClassReference('com.mysite.assets.skins.NavigationButtonSkin');
Then, NavigationButtonSkin looks something like this:
public class NavigationButtonSkin extends UIComponent {
// imports, constructor, etc
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
// initialize fillColors, fillAlphas, roundedCorners, etc
switch( name ){
case 'upSkin':
fillColors = [getStyle('backgroundColor'),getStyle('backgroundColor2')];
break;
// do the same for overSkin, downSkin, disabledSkin, etc
}
// use this.graphics to draw background
// use this.graphics to draw border on top of background
}
}
I commented out some of the straight forward parts, but let me know if this is a bad/inefficient way of doing this - and how to improve.
Thanks!
In terms of performances, it would be better that your skin inherits from ProgrammaticSkin instead of UIComponent.
ProgrammticSkin itself inherits from Shape and provides utility methods for skinning such as verticalGradientMatrix, drawRoundRect, ...
That's all I can say looking at your code.
Good point is you use programmatic skin instead of bitmap/swf based skins.
Okay, I'm not getting where you're getting at with this. You just want to know if you're doing it right? I'm assuming that your skin: ClassReference('com.mysite.assets.skins.NavigationButtonSkin'); is added to the css of a Button, which is good, however I don't see why you're doing it all in Actionscript. Seems inefficient and essentially you're losing all the ability of mxml layouts and support for Catalyst (if you'd ever need it in the future).
Try creating a skin in Flash Builder, it'll create an MXML with the default button skin where you can just edit it as you please. It's also A LOT easier to do state based design using mxml over actionscript. You should modify from there on and have a separate skin for each button types.
EDIT: oh crap, didn't see this was Flex 3... Get with the program ;) Just listen to what Florian said.
I have html table with 1 row to fill in job details for a position.Now If a user wants to fill in job details for another position,on clicking a link, a new row should be created dynamically each time the user clicks the link.Can any one please help me with the code in html
I'm using frontpage.
Thanks,
Vix
I would suggest looking into jQuery, the most powerful javascript framework. It is popular and you can find lots of references, resources, plugins, code etc. to help you do lots of this stuff.
Here is a stackoverflow question covering adding a table row to a table using jQuery.
Add table row in jQuery
in simple Dom-Javascript without any frameworks you could use something like this
var tr = document.createElement('tr');
var td1 = document.createElement('td');
var someDivToAppend = document.createElement('div');
someDivToAppend.innerHTML = "Some basic text content";
td1.appendChild(someDivToAppend);
tr.appendChild(td1);
...
But I guess that's probably too much handy work, a library like jQuery could help you there.
You could look at: http://api.jquery.com/append/
Also look at the YUI Datatable. Very full featured, and well documented.
I have a flex application where Im displaying login data using an advanced datagrid. Is it possible to show the data in this advanced datagrid, by a page wise way? if so do you have any sample coding to do this. thanks
Here's an example I think might help you: http://gurufaction.blogspot.com/2007/02/flex-datagrid-paging-example-with.html
SWF: http://develop.gurufaction.com/App.swf
MXML: http://develop.gurufaction.com/src/App.mxml
You can use the "filterFunction".
Write a custom function to filter data according on which "page" you are browsing.
Another solution is to split the original array to get several array which will be assigned according to the current page.
I have 2 components for example (editor.mxml using mx:windows), when I click an edit button, I want to get the current value from the other component's datafield? (datagrid.mxml using mx:window)
I do know how to access the main MXML's datagrid by parentDocument or Application.application method, but stumped block if I want to access other way as mentioned above. Keep the code as simple as possible.
You could either do dependency injection, that is, give component A a reference to component B so that they can communicate directly (example of tighter coupling,) or have both components communicate through a common mediator using events (example of more loose coupling.)
Both of those options would be implemented wherever it is that you're creating those components (A and B in this example) and adding them to the display list.
This might be more complicated than it deserves, and it smacks of Pattern-Fever, but you could use a mediator class that listens for the CLICK event from the button and knows enough about the other component to query its property. It could even transmit that data using a custom event, which the button listens for.
While this involves three classes instead of two, it often turns out to be easier to have two components that focus on looking good and one that worries about coordination.
Cheers
Try this:
FlexGlobals.topLevelApplication
This points Your root. From the root You can grab every element You want.
You can also add an id to the custom component like this,
<custom:Editor id="myCustomComponent">
</Editor:AddressForm>
and
access your datagrid's value like this,
var data:ArrayCollection = myCustomComponent.DatagridID.dataProvider;