Flexsheet not allowing alpha numeric input

Posted by: curiosichi on 14 November 2018, 10:01 am EST

    • Post Options:
    • Link

    Posted 14 November 2018, 10:01 am EST

    http://jsfiddle.net/p8unjjnw/48/

    I identified an issue with the flexsheet that is preventing me from entering alpha numeric characters into the cell.

    In col1, you can enter numeric or alpha or any combination of the two, but in col 2, if you enter alpha characters they are removed. More interesting, not only are they just removed, they are actually parsed out. If you enter “1a2b3c” into col 2, you will get a final result of “123” in the col.

    What is perplexing, and only discovered as I was writing this report (and outside the dynamically created columns of my project), is below:

    
    
    data.push({
                col1: col1[i],
                col2: Math.round(Math.random() * 20000)[b].toString()[/b]
            });
    
    
    

    If I type/cast the value to string, only then can i enter alpha numeric. So this says to me that unless I do this to every column and manage the types myself, I will encounter this issue with strongly typed columns/cells.

    I feel that these fields should be of type ‘any’ or columns forced into a type unless you add the attribute to the column or cell.

    Have I identified an issue or a feature?

  • Posted 14 November 2018, 10:08 am EST

    I should also add, I add sheets dynamically with addBoundSheet(), so how would I “type/cast” the columns/cells i desire of this dynamic sheet to one that would accept alpha numeric input?

  • Posted 14 November 2018, 8:43 pm EST

    As the default behaviour, FlexGrid is designed to automatically identify the data type of a column and prevent users from entering data of a different type.

    If you would like to have an alphanumeric column, then you may simply set the dataType of the column to wijmo.DataType.String.

    Please refer to the following updated sample: https://jsfiddle.net/2a6ceup5/

    In case of adding sheets dynamically using addBoundSheet() method, you may set data-type using instance of the returned sheet.

    Please refer to the following code snippet:

    let sheet = flexSheet.addBoundSheet('sheet1', data);
    sheet.grid.columns.forEach((col)=>{
      col.dataType = wijmo.DataType.String;
    });
    
    

    You may also refer to the following sample: http://jsfiddle.net/vrbozd4f/

    ~Sharad

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels