<ej:Grid ID="Grid" runat="server" AllowPaging="true"> <ClientSideEvents QueryCellInfo="cellInfo" /> --------- --------- </ej:Grid>
<script type="text/javascript"> function cellInfo(args) { if (args.column.headerText == "GPS") { if (args.text.indexOf("°") == -1) { var dms = getDMS(args.data.Location["Latitude"]); // Get DMS value from latitude // Set DMS format using grid formatting method var text = this.formatting("{0:D2}", dms.degree) + "°" + this.formatting("{0:D2}", dms.min) + "'" + this.formatting("{0:D2}", dms.sec) + "''"; $(args.cell).text(text); // Set formatted text to the cell } } } function getDMS(val) { // convert decimal degree to DMS var dms = {}; var degree = dms["degree"] = Math.floor(val); var min = dms["min"] = Math.floor((val - degree) * 60); dms["sec"] = Math.floor((val - degree - min / 60) * 3600); return dms; } </script> |
<ej:Grid ID="Grid" runat="server" AllowPaging="true"> <Columns> -------- -------- <ej:Column Field="Location.Latitude" HeaderText="GPS" Width="100" Type="String"> <EditTemplate Create="create" Read="read" Write="write" /> </ej:Column> </Columns> <script type="text/javascript"> function create() { return $("<input>"); }
function write(args) { args.element.ejMaskEdit({ width: "100%", maskFormat: "##° ##' ##''", value: args.rowdata.Location !== undefined ? getMaskValue(args.rowdata.Location["Latitude"]) : "" }); }
function read(args) { return args.ejMaskEdit("get_UnstrippedValue"); } |
We have an issue "MaskFormat character # not allowed +/- symbol” and created a new support incident under your account. . Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Regards,
Gowthami V.