﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Calculator custom editor</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Calculator-custom-editor/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Calculator custom editor</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Calculator-custom-editor/</link><pubDate>Thu, 18 Aug 2011 23:31:14 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;There are a number of complications that maybe caused by the period or comma, which is why I think the developer prevented in the first place.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;By allowing user to input period (“.”) character, the calculator is no longer type safe. This means that users may input an invalid number that produces an error when calculated.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;For example: 17..1 &amp;#43; 44.1.9.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;So, accepting the period will need more advanced masked input such as those available in WebInput of UXMaskedInput.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;However, if you feel that you can manage the errors, I can suggest you to make a minor modification to the Calculator.js file in EditorPack1. Please find and modify the code shown in the following snippet code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Original code:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;...
if (!((48&amp;lt;=e.keyCode &amp;amp;&amp;amp; e.keyCode&amp;lt;=57) || (96&amp;lt;=e.keyCode &amp;amp;&amp;amp; e.keyCode&amp;lt;=105) || e.keyCode == 115 || e.keyCode==32 || e.keyCode==8 || e.keyCode==37 || e.keyCode==39))
{
	e.cancelBubble = true;
	e.returnValue = false;
}
...&lt;/pre&gt;&lt;br /&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Modified to:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;...
if (!((48 &amp;lt;= e.keyCode &amp;amp;&amp;amp; e.keyCode &amp;lt;= 57) || (96 &amp;lt;= e.keyCode &amp;amp;&amp;amp; e.keyCode &amp;lt;= 105) || e.keyCode == 115 || e.keyCode == 32 || e.keyCode == 8 || e.keyCode == 37 || e.keyCode == 39 || e.keyCode == 110 || e.keyCode == 190)) {
	e.cancelBubble = true;
	e.returnValue = false;
}
...&lt;/pre&gt;&lt;br /&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;keyCode for the period character, 110 and 190, is added into the "if" conditional code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Calculator custom editor</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Calculator-custom-editor/</link><pubDate>Thu, 18 Aug 2011 20:18:08 GMT</pubDate><dc:creator>Skaur</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am using Calculator custom editor in one of columns of webgrid. I want to be able to manually type in the period operator (.) in that column for decimal values but its not allowing me. I can pick that decimal point from dropdown of calculator editor though. I checked Calculator.js in EditorPack1 and it seems its returning false if( e.keycode == 115) which is for period and greater operators. Please suggest some workaround for this.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Sukhdeep&lt;/p&gt;</description></item></channel></rss>