Triggering Function Event on Selecting a row in an Advanced Data Grid - apache-flex

The Following code seems to only be working when i have editable="true" on the Advanced Data Grid. But I don't want it it be editable. Anyone have any idea or experience with this issue?
The docs don't say anything about it needing to be editable, and i dont see why it should need to be.
http://docs.huihoo.com/flex/4/mx/events/DataGridEvent.html#ITEM_FOCUS_IN
a_data_list.addEventListener(AdvancedDataGridEvent.ITEM_FOCUS_IN, clickedRow);
public function clickedRow(event:AdvancedDataGridEvent):void
{
trace("datagrid line was clicked");
}

You need to listen to the "change" (ListEvent.CHANGE) event if you want to know when rows are selected/deselected.

Actually, sorry christophe, the proper solution to the issue is using
ListEvent.ITEM_CLICK
Because for example if the highlighted item is already highlighted it will not trigger the function because it does not "change" what does work perfectly for this issue though is item click. But thanks for pointing me in the right direction

Related

Multiple functions to be render in Clicked EditCommandTemplate DataGrid Blazorise

on edit the bit should be true and also context.clicked should also work
this is not working
Clicked="#(()=> OnEditBtn(context))"
First of all, I am not quite sure what is your problem, you could try to expand on your question.
Secondly if your problem is not showing some component after changing variable, try to call StateHasChanged() to redraw component, if your OnEditBtn function is the bound function in <Button Clicked=#..., could be the issue.
But I am just guessing with what I have to work with.

The text in the dxDatagrid should be automatically in selected mode on cell click

I need the text that is available in the dxDataGrid should be in selected mode on clicking that cell in edit mode..??
I have even tried onCellClick event too..But no where I found the solution..
onCellClick:function(e){
e.cellElement.select();
},
Please help me out...
Ran into this problem too, this did the trick for me.
onRowClick: function (e) {
$("input.dx-texteditor-input[type=text]").select();
},
The problem I noticed, was the timing of the call. The contents to be selected cell aren't ready when the onCellClick fires. By using the OnRowClick(which fires right after the onCellClick), the select is called after the cell is done rendering. Probably several ways to do the actual select, the timing is the real issue.

Flex 4: Help adressing an object

I found this amazing code to make a dropdownlist with check boxes: Click here
I implemented it and it works, except for one detail I cant for the life of me get the array of selected checkboxes back.
I have implemented as follows:
<local:MultiSelectionDropDown maxHeight="300" x="181" y="-7" width="233" requireSelection="false" itemRenderer="myComponents.MultiSelectItemRenderer" skinClass="myComponents.MultiSelectionDropDownListSkin" dataProvider="{GetIsList.lastResult.ReportFilterList.ReportFilter}" id="dropISLIST" color="#000000"/>
What I cant figure out is what to call to get dropISLIST to give me back the list of selected check boxes and their values.
Does anyone have any ideas.
Please and thank you in advance for any help you can provide....
If your item renderers are properly reporting their checked state back to your data provider, then it is as simple as iterating through dropISLIST.dataProvider. If the data provider does not reflect what is shown in the droplist, then your first job is to make sure your item renderers are working correctly. If you are having trouble, feel free to share your code for the item renderer and we can help you sort it out.

RadioButtons, ListViews, and Grouping, oh my!

I've got a project I'm working on where I need to put a RadioButton inside a ListView, and have them all have the same GroupName. (can't use RadioButtonList, long story).
Anyway, this seems to be a well known bug in .NET, so I've implemented the solution found here:
ASP.NET RadioButton messing with the name (groupname)
This works perfectly, but with one small bug which undoubtedly will come back to bite me. If I click one radio button, and then click another while the javascript function is still running and has not completed; I can get 2 radiobuttons in the same group selected.
Any ideas? If you need clarification; leave me a comment and I'll update my post.
EDIT: I believe I fixed my own issue here. See my posted answer below.
Would something like this work?
if (!rbClicked)
rbClicked=True;
runJavascript();
rbClicked=False;
I admit I didn't do alot of research, but this is how I've usually solved this type of problem.
Turns out I was misguided here.
Later on in the page lifecycle; I was adding an additional onclick event that was overwriting the previous value.
In the following example:
var radiobutton = new System.Web.UI.WebControls.RadioButton();
radiobutton.Attributes.Add("onclick", "test1");
radiobutton.Attributes.Add("onclick", "test2");
the onlcick attribute is set to "test2"; test1 is lost.
I ended up fixing it by appending to the existing attribute; see below:
radiobutton.Attributes["onclick"] = string.Format("{0};{1}", radiobutton.Attributes["onclick"], "My Second Script");
This works without issue.

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

Resources