ParamQuery grid support forum

General Category => ParamQuery Pro Evaluation Support => Topic started by: pq33user on April 23, 2018, 11:03:39 am

Title: How to cancel "left justified"
Post by: pq33user on April 23, 2018, 11:03:39 am
Hi

Even if you input a space at beginning of the cell, space is deleted when you complete the input.
Is it possible to not delete the space?

Thanks in advance.

Title: Re: How to cancel "left justified"
Post by: paramvir on April 23, 2018, 11:45:56 am
Input is always trimmed.

Please add text-align or text-indent css styles to the cells for stated purpose.
Title: Re: How to cancel "left justified"
Post by: pq33user on April 23, 2018, 12:32:49 pm
Thank you.
I would like to register the inputed space in the database, so I will consider another plan.
Title: Re: How to cancel "left justified"
Post by: paramvir on April 23, 2018, 01:03:10 pm
you can use cellBeforeSave event to get raw value ( including empty spaces at boundaries ) in an editor : https://paramquery.com/pro/api#event-cellBeforeSave

Code: [Select]
cellBeforeSave: function(evt, ui){
var newVal = ui.newVal;
alert(newVal);
},
Title: Re: How to cancel "left justified"
Post by: pq33user on April 24, 2018, 06:14:40 am
Thank you.

By setting the value of ui.newVal to ui.rowdata in the cellSave, it was possible to set the value to include the space.
However, it is trimmed on display.
Is it possible to make the same value on display?

Code: [Select]
cellSave: function (evt, ui) {
    ui.rowData[ui.dataIndx] = ui.newVal;
}
Title: Re: How to cancel "left justified"
Post by: pq33user on April 24, 2018, 07:59:44 am
The problem was resolved by replacing space with " " in the colModel's render event.
Thank you, you've been so helpful.

Code: [Select]
render: function (ui) {
    return { text: ui.cellData.replace(/\s/g, "&nbsp") }
}