I'm using MVC to create editors and when I pass custom Html attributes to the HtmlAttributes property, the custom attributes are put into a span tag instead of the input tag. Is there a reason for this? If we want to use any form of validation other than the IgniteUI validation, this makes it very difficult.
<
div id="ScreenControlTextEditor55756" class="ScreenControlTextEditorInline basiccriteriarow " data-name="BasicCriteriaItem" data-internalid="55756">
<label class="LabelInline" for="BasicCriteriaItem"> </label><span data-controlId="55756" data-controlType="igEditor" data-dataType="A" data-defaultAction="SearchPaneMenuSearch" id="BasicCriteriaItem"></span><input name="BasicCriteriaItem" type="hidden" /><script type="text/javascript">//<!--<![CDATA[
$(
function () {$('#BasicCriteriaItem').igEditor({ type: 0, button: 'clear', disabled: false, excludeKeys: null, height: 25, hideEnterKey: false, includeKeys: null, maxLength: 50, nullText: 'Item', selectionOnFocus: -1, textMode: 'text', toLower: false, toUpper: false, inputName: 'BasicCriteriaItem' });});
//]]>-->
</script>
Hello Ryan,
I’ve logged this issue with development id number:172344.
I’ve also opened a private case with number CAS-137037-P2P5J5 so that you may track the progress of the issue.
You can view the status of the development issue connected to this case by selecting the "Development Issues" tab when viewing this case on the web site.
Please let me know if you need more information.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://ko.infragistics.com/support
Hi Ryan,
Thank you for this information. From this we've been able to identify that the problem with how the HtmlAttributes are being set is coming from the our side. I will follow-up with you, with a development issue id # once I have this logged and submitted to our engineers.
Here is the MVC portion it's not created directly in the view itself, but through a helper call - let me know if this is what you need or you need something else. Thanks!
internal MvcHtmlString GetTextEditor(ScreenControl screenControl, string defaultActionAttribute) { IDictionary<string, object> customHtmlAttributes = this.GetCustomAttributesForTextEditor(screenControl, defaultActionAttribute);
// build text editor MvcHtmlString editorHtml = HtmlHelperExtensions.Infragistics(this.Helper) .TextEditor() .ButtonType(TextEditorButtonType.Clear) .Disabled(false) .Height(25) .HideEnterKey(false) .HtmlAttributes(customHtmlAttributes) .ID("myControl") .MaxLength(50) .NullText("mynulltext") .SelectionOnFocus(TextEditorSelectionOnFocus.SelectAll) .TextMode(TextEditorTextMode.Text) .Render();
// return both label and text editor return this.Helper.ConcatenateHtml(this.GetControlLabel(screenControl), editorHtml); }
private IDictionary<string, object> GetCustomAttributesForTextEditor(ScreenControl screenControl, string defaultActionAttribute) { IDictionary<string, object> customHtmlAttributes = new Dictionary<string, object>(); customHtmlAttributes.Add("data-controlType", "igEditor"); customHtmlAttributes.Add("data-controlId", screenControl.ObjectId); customHtmlAttributes.Add("data-dataType", "A");// alpha customHtmlAttributes.Add("data-defaultAction", defaultActionAttribute); return customHtmlAttributes; } }
Hi Ryan Rupp,
Can you send me the part of your view where you instantiate the igTextEditor and pass the HtmlAttributes. Because I'm trying to reproduce the behavior and the attributes are inserted correctly. But I might not reuse the correct environment for your case.. So it's best if I work directly with your scenario to help you with this manner.
Thanks,
This is to let you know that I am looking into this and will follow-up with you on this thread upon further research this.