ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: pq33user on September 05, 2018, 02:25:37 pm

Title: How to paste a numerical value including thousand separator
Post by: pq33user on September 05, 2018, 02:25:37 pm
Hi.

When pasting numerical values including ","(Thousand separator), value after "," can not be pasted.
Is there a solution?

Thanks in advance.


e.g.
Title: Re: How to paste a numerical value including thousand separator
Post by: paramvir on September 07, 2018, 12:40:01 pm
beforePaste event is used for this purpose.

https://paramquery.com/pro/api#event-beforePaste
Title: Re: How to paste a numerical value including thousand separator
Post by: pq33user on September 07, 2018, 01:46:36 pm
Thank you.
In https://paramquery.com/pro/demos/infinite_scroll (https://paramquery.com/pro/demos/infinite_scroll) it was solved by adding the following code after beforeTableView.

Code: [Select]
beforePaste: function(evt, ui){
    //sanitize pasted data.
    var CM = this.getColModel(),
        rows = ui.rows,
        area = ui.areas[0],
        c1 = area.c1;

    for(var i=0; i<rows.length; i++){
        var row = rows[i];
        for(var j=0; j<row.length; j++){
            var column = CM[j+c1],
                dt = column.dataType;
            if( dt == "integer" || dt == "float" ){

                row[j] = row[j].replace(/\,/g,"");
            }
        }
    }
}

v3.3.0-3.4.x does not have beforePaste.
Is there an Events that can be used instead?
There was no areas in ui of beforeValidate.
Title: Re: How to paste a numerical value including thousand separator
Post by: pq33user on October 10, 2018, 11:46:08 am
Hi.

I decided to upgrade PQGrid used in my project from v3.3.0 to v5.1.0.

Thank you for your support.
Title: Re: How to paste a numerical value including thousand separator
Post by: paramvir on October 10, 2018, 11:50:18 am
This board is for evaluation users.

Please share your Pro credentials so that your account can be upgraded.
Title: Re: How to paste a numerical value including thousand separator
Post by: pq33user on October 10, 2018, 01:28:08 pm
OK.
I confirmed it within the company that I already registered Pro license to another user ID.
Next time I will "Help for ParamQuery Pro" to use Pro license user to ask.