Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dan Brown on Jun 11, 2009 06:48
open dhtmlx forum
pasting price data from Excel into fields formatted as PRICE come up as zeros

When I paste price data from Excel, if the fields are typed in DHTMLX as "PRICE", the grid populates with zeros! If the fields are typed as "EDN", the values appear but will not save. Here's my code for pasting:

    function pasteData() {
        mygrid.enableCSVAutoID(true);
        mygrid.addRowFromClipboard();
    }

So here's my questions:
(1) how might I be able to properly display money while being able to paste from excel? My underlying field is FLOAT (not MONEY).
(2) some of the spreadsheet data represents negative values with parenthesis. How might I convert say "($15.75)" to "-$15.75" upon paste?

I understand that using the type of "PRICE" has automatic colorization differences for positive and negative numbers...I'm not put off by that, but I've tried several combinations of solutions with no success. As such, I'm plenty open to suggestions!

Thanks!

Dan Brown
Answer posted by dhxSupport on Jun 11, 2009 08:30
1. Dyn eXcell type doesn't support showing float number. If you interting\pasing float number dyn eXcell automatically convert it to the 0.
2. You can implement custom eXcell type which will set and get necessary values while clipboard operations (getValue() and setValue() inner cell's methods). Please see more information here http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Custom_excell_creation.html#grid_cexc