I was looking at the tutorial from AMU at https://www.youtube.com/watch?v=lKz3z6gw1fQ, which outlines how to use a search box to narrow down records, and wanted it to reload the datasource onInputChange instead of onValueChange so the user doesn't need to change focus for the reload to happen. Simply putting the 'Reload Datasource' onInputChange doesn't work. Is this a bug?
for anyone else that has this issue, I was able to solve it by adding
widget.value = widget.value;
widget.datasource.load();
Don't know why that would be necessary, but it worked.
Related
I have to edit two objects of the same datasource. I'm using UserPicker widget to change the person attached to the objects (picking up just the email).
In the beginning I have:
ObjectA { owner: owner1#sample.com }
ObjectB { owner: owner1#sample.com }
After this, I want to change the owner of ObjectA to Owner2. This works out fine.
Then, using the same edit widget (with a different datasource item), I want to change the owner of ObjectB to Owner2, also. However, this does not work out, since the UserPicker widget does not register the change from Owner1 -> Owner2. This happens because the UserPicker has stored the value Owner2 from the first change I made (so to the app it seems that I'm making a change Owner2 -> Owner2 .. onChange not triggered, datasource not saved).
I've tried altering the widget value on attach, but I've yet to get it to work. Is this something that should be fixed on the AppMaker side, too?
Thanks for your help, please ask clarifying questions if you don't understand.
Ok, just in case anyone else is having this problem while the fixing of the bug is still under work (I reported the bug though). This is how I dealt with it:
UserPicker widget onDetach:
if(widget.datasource.item.OwnerEmail !== widget.value) {
widget.datasource.item.OwnerEmail = widget.value;
}
This makes sure that the value change is saved into the record anyway, when the widget is being detached.
However, this solution is missing the automatic validation (which is done in UserPicker widget by default). So you might need to make sure that the entered value is actually an email, in this solution there is no guarantee of that.
There are probably better ways to do this, but this is just a quick fix I came up with.
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.
I have a system and I had a problem today, when the user double-click on button control and the system process the operation twice.
I found a solution with this code on the button:
OnClientClick = "this.disabled = true; this.value = 'submiting ...';" UseSubmitBehavior = "false"
However, I have several pages in the system, with several buttons ... is there any way to set these attributes to all the buttons of the application?
Thank you!
What about using a clientSide approach by using JQuery and disabling all Submit controls (jsfiddle)
$(document).ready(function () {
$(' :submit').click(function (event) {
$(this).attr("disabled","true");
});
});
I am quite new to JQuery so if there are any better solutions or I am completly wrong, pls let me know!
I'm not sure, but it seems that it is possible through skin file.
You can create a custom button. Here you have example how to create button that displays confirm window on client click. Almost what you wan't.
http://dhavalupadhyaya.wordpress.com/2008/07/20/creating-custom-controls-in-asp-net/
Than you would have to change all the asp:Buttons on every page to someTag:YourButton. Maybe simple Find/Replace. But I think there is possibility to configure in web.config so that ASP.NET uses someTag:YourButton everytime it sees asp:Button. But can't find now how to do it.
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
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.