1) How to set an event handler using a helper? I have this in an MVC4 app:
@(Html.Infragistics().TextEditor().ID("Name").Width(500).Value(Model.Name).Render())
I have tried all these:
$("#Name").bind("igtexteditorvaluechanged", function () { alert("EVENT!"); });
$("#Name").on("igtexteditorvaluechanged", function () { alert("EVENT!"); });
// Using the helper and delegate works BUT it generates another issue: when typing in the editor every character is duplicated.
$(document).delegate("#Name", "igtexteditorvaluechanged", function (evt, ui) { alert("EVENT!"); });
But, if instead of Html.Infragistics().TextEditor() I use:
<div class="editor-field"> <input id="Name" /><input name="Name" type="hidden" /> </div>
$("#Name").igTextEditor({ width: 500, nullText: "Enter Text", value: "@Model.Name", inputName: "Name" });
Then the event is fired using delegate function (I haven't tested bind and on functions using jQuery) and the duplicated characters issue disappears.
2) How to show the correct value for latin characters?
When using the last approach I have another issue: displaying things like "OTOÑO" looks like "OTOÑO" I have tried this:
nullText: "Enter Text", value: "@Html.Encode(Model.Name)", inputName: "Name"
But the result is: "OTO&#209;O"
3) Delegate or On function?
In this link http://ko.infragistics.com/help/jquery/using_events_in_netadvantage_for_jquery.html say "The delegate function is obsolete in jQuery version 1.7, making on the preferred approach for establishing event handlers" I am using jQuery 1.8.2 so I would like to use the delegate function if there is no way to use a helper to set an event handler, but, as I said before, on function doesn't work with jQuery.
Hello Luis,
I'm a little confused. Could you please send me a sample that reproduces the issue?
Looking forward to your response.
Regards,
Tsanna
Hi Tsanna, at this moment I am very busy with my project, as soon as possible I will post an example. Thank you so much for your kind.
Thank you for your feedback.