<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Masked inputs in MVC apps</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/masked-inputs-in-mvc-apps</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/masked-inputs-in-mvc-apps/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>vi6cmevm on Masked inputs in MVC apps</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/masked-inputs-in-mvc-apps#p31402</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/masked-inputs-in-mvc-apps#p31402</guid>
        	        	<description><![CDATA[<p>Hi All,</p>
<p>While evaluating the free trial version for commercial use, I am trying to add a masked input control to the Edit Dialog using Digital Bush plugin but itâ€™s not cooperating. While the plugin itself is working flawlessly for me, combined with a custom edit control it is not masking anything. Tried other plugins with no luck.</p>
<p>Having modified one of MVC demoâ€™s, I ended up with the following changes.</p>
<p>Model:<br />
new JQGridColumn { DataField = "ShipName",<br />
Â Editable =Â  true,<br />
Â EditType = EditType.Custom,<br />
Â EditTypeCustomCreateElement = "createGridEditElement",<br />
Â EditTypeCustomGetValue = "getGridElementValue"<br />
Â }Â Â Â Â Â Â </p>
<p>View:<br />
Â Â Â  function createGridEditElement(value, editOptions) {<br />
Â Â Â Â Â Â Â  return "&#60;input id='ShipName' type='text'&#62;&#60;/input&#62;";</p>
<p>Â Â Â  }</p>
<p>Â Â Â  function getGridElementValue(elem, two, three) {<br />
Â Â Â Â Â Â Â  return $(elem).val();</p>
<p>Â Â Â  }</p>
<p>Â Â Â  $(document).ready(function () {<br />
Â Â Â Â Â Â Â  $("#OrdersGrid").setColProp('ShipName', {<br />
Â Â Â Â Â Â Â Â Â Â Â  editoptions: {<br />
Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  dataInit: setTimeout(function () { $('#ShipName').mask("99-99"); alert('mask has been set') }, 1000)<br />
Â Â Â Â Â Â Â Â Â Â Â  }<br />
Â Â Â Â Â Â Â  });<br />
Â Â Â  });</p>
<p>The above dataInit handler along with its timeout is just my latest sample. I am getting my alert but no masking action.<br />
While there is a sample of using masked input in JQGrid Iâ€™d really like to see it working in an MVC app.<br />
<a href="http://www.ok-soft-gmbh.com/jqGrid/MaskedInput.htm" rel="nofollow" target="_blank"><a href="http://www.ok-soft-gmbh.com/jq" rel="nofollow">http://www.ok-soft-gmbh.com/jq</a>.....dInput.htm</a></p>
<p>Is there a working MVC JQGrid demo complete with edit popup and a masked input?</p>
<p>Whether it would be using custom controls or not is not important as I am trying to accomplish the masking of user inputs using the most straightforward approach available. Perhaps there is an option in JQGridColumn that I am missing.</p>
<p>Any help will be highly appreciated.</p>
]]></description>
        	        	<pubDate>Fri, 21 Nov 2014 18:50:35 +0200</pubDate>
        </item>
</channel>
</rss>