Flexicious - Close itemEditor - apache-flex

I got a very stupid problem which I just can't resolve : I want to close an item Editor in my FlexDataGrid from Flexicious.
Indeed, when I hit the Enter key, I enter my itemEditEndHandler function, but then the itemEditor don't close (however it close correctly when hitting Escape or Tab key). I was first thinking to use a method like datagrid.destroyItemEditor() (like with the common datagrid...) but there isn't any obvious methods or way to close it !!!
sadly, there isn't a lot of doc for the FlexDataGrid from Flexicious :'(
Did anybody already have meet this problem ? Do you know some good way to force the closing of the itemEditor ?
Thanks

Try grid.bodyContainer.endEdit(grid.bodyContainer.getCurrentEditor()).
We will add destroyItemEditor to the next release.

Related

Cocoa: custom NSCell not respond double click action

I focus on a cocoa app supported on 10.6, and I use cell-based NSTableView.
I custom the NSCell so that it can display image and text.
The Problem here is : when I set the doubleClickAction to the tableview, it did not respond.
I have already found it due to the custom cell. I guess the cell stops the responding chain, but I don't know how to fix it. I search the document, and I've no idea which method to be overridden.
Please give some guides and Thanks!
For anyone coming across this question as I did, the solution in my case was a missed call to:
[self.tableView setTarget:self]; //This was missed
[self.tableView setDoubleClickAction:#selector(doubleClick:)];

Why won't this checkbox refresh as expected in Meteor?

I'd like to simplify the TodoMVC app for meteor. There is currently some observe that should not be needed I think. I simplified a bit successfully, but when I try to simplify it further the updating doesn't work properly.
For instance, it should get selected when I click on all the items in the todo list but doesn't. When I refresh the page it is selected though.
Edit: Got rid of an unrelated error, thanks to #TomColeman.
I'm seeing that error before the patch is applied. It's due to the Meteor.flush on line 74.
I'm not sure why that flush is needed? (I'm also not sure why there's an error either).
Turns out it simply was because the correct html is checked="checked", not simply checked.

How to control cursor (carat) position in TextInput in Flex 4.5

I need to handle diagraphs and then convert them on the fly to the proper unicode representation. For example when the user types in:
Sx
My app needs to replace it with:
Ŝ
Now, I've been able to do the replacement no problem. The issue though is that once I've done the replacement, the cursor goes to the beginning of the textbox rather than the end. As I'm trying to update the user's text on the fly, this obvious doesn't work.
How can I get it so that once I replace the text in the TextInput box, the cursor is on the right hand side rather than the left?
Found a solution.
All you have to do is instead of updating the whole text, wipe the current content and then use:
textInput.appendText()
Hopefully this will help someone else :)
The setSelection method is how you set the cursor
textInput.setSelection(textInput.text.length, textInput.text.length);
You can get the current beginning of the selection with TextInput.selectionAnchorPosition and the end of the selection with TextInput.selectionAnchorPosition
Take a look at this SO Question: How do you programmatically move the caret of a Flex TextArea to the end?
If you are using a textArea then this will work (from the selected answer):
textArea.selectionBeginIndex = textArea.length;
textArea.selectionEndIndex = textArea.length;
For the people coming here for the solution for the Spark textInput, this is the way:
textInput.selectRange(textInput.text.length, textInput.text.length);

How to turn on line number tooltip while scrolling infragistics ultrawebgrid

I once saw this feature in action but I don't know how to turn it on. The grid can show a tooltip with the current row number (or row ID) while dragging the scrollbar. This helps you to stop the scroll in the right place. I'm assuming some property will turn this on, but I can't find it.
Maybe it is also dependent on the scroll mode?
UPDATE:
In the image below you can see an example of the tooltip I'm looking for. This is displayed while the scrollbar is being dragged (up or down). The number in the tooltip is the row number (you can't see it in this image, way to the left in the grid). This is the same grid that I am using now. Just from a very old build of our product. Somehow this tooltip was turned off. And no one knows how to turn it back on :(
I'm pretty sure this is a built in feature of the ultrawebgrid. Not something that required extra coding.
alt text http://img138.imageshack.us/img138/6337/croppercapture.jpg
Right! Now that we've established that you have version 6.3, I've hopefully got a solution for you. I don't have 6.3 myself, but I've got a slightly later one that I think didn't have Virtual Scrolling added as a feature yet.
So try this code:
webgrid.DisplayLayout.XmlLoadOnDemandType = XmlLoadOnDemandType.Virtual;
This should automatically put a tooltip on the grid as you scroll down. Have a look here for a running sample... (and remember to choose the virtual option)
Here's hoping!
Rob G
I don't know if there's a UltraWebGrid property to simply turn on the behavior you're looking for. I almost suspect you experienced this feature in another application, perhaps not even a web based one (sorry!). I do however, know exactly what you're talking about.
As a work-around, I would suggest allowing the user to input the destination row number, and to simply "jump" to it, using this technique.
If that doesn't satisfy you, it may be possible to achieve this behavior with JavaScript. You would need to use something like this technique to get the information you need, estimate (or actually detect, if possible) the row number, and the rest is up to the GUI. I would go with the work-around described above though :)
I'm typing this from memory here as I don't have it installed on this machine and I haven't seen that setting before, but how about adding something like this to the InitializeRow event:
foreach (UltraGridCell cell in e.Row.Cells)
{
if(cell.Column.Key == "Topic") //from your grid above
cell.Title = cell.Row.Index;
}
The row object itself does not have a "Title" property from memory, but the cell does.
See if that works...
Regards,
Rob G
OK - I think I've found your illusive setting:
You can set the TipStyleScroll on the Override to Show on the Grid (this may be version dependant).
You can determine which field is displayed as the tooltip by using the ScrollTipField property of the band.
I did it like so:
myGrid.DisplayLayout.Override.TipStyleScroll = TipStyle.Show;
myTopBand.ScrollTipField = "Id";
...and it works like a charm!
If it's a really long list, sometimes setting the ScrollStyle to Deferred helps:
myGrid.DisplayLayout.ScrollStyle = ScrollStyle.Deferred;
Hope that helps...
Rob G
Once again - not sure which version you have, so to be safe here's somthing you can try from 2009 version:
myGrid.Behaviors.VirtualScrolling.Enabled = true;
myGrid.Behaviors.VirtualScrolling.TooltipVisibility = DefaultableBoolean.True;
If your scrolling mode is Deferred instead of Virtual, then the tooltip is normally enabled by default.
You can find full details about this feature here
Hope that helps,
Rob G

Flex: Is there any way to find find out when a ComboBox is open?

I may be missing something here because I thought this might be really easy but...
Using Flex, how can you tell when a ComboBox is open? I do find the open and close events that this component dispatches can be flaky so I'm looking for something a little more solid - it's probably staring me in the face.
How about checking either the existence or the visibility of the dropDown component?
The dropDown is a component of type ListBase, and can be accessed through the dropDown property. So maybe something like this (I didn't have time to test this myself):
if (myComboBox.dropDown != null && myComboBox.dropDown.visible) {
// myComboBox is open
}
The myComboBox.dropDown != null is a safety check so you will not get runtime errors trying to access the visible property of a null object.
The designers probably thought it was enough with the open and close events.
EDIT: I'll clarify that. Looking for a property that would reveal the opened/closed status of the combobox I fail to find it. And to my experience there's nothing flaky about the event system.

Resources