General Category > ParamQuery Pro Evaluation Support

Setting Default Values for Columns in Batch Editing with grid.addRow

(1/1)

omerix:
Hello,

I?m currently using the "Batch Editing" feature in ParamQuery, and I need to assign default values for certain columns.

For example, when I click the "New Product" button, it triggers grid.addRow. I?d like to know if there?s a way to define default values directly in the colModel, something like a dataValue property, so that addRow can automatically use those values.

Example:

--- Code: ---{title: "Product Name", dataValue: "Test Product ABC"}, 
{title: "Quantity", dataValue: "1"}

--- End code ---


Currently, I?m using an AJAX call to set a cookie when grid.addRow is triggered and then fetching the default values from the cookie after saving. However, this seems like an unnecessary step for what should be a straightforward task.

While I can pass default data to addRow like this:


--- Code: ---grid.addRow({newRow: defaultValue});

--- End code ---

But, there are cases where I?m adding data via copy-paste, and addRow doesn?t seem to handle those scenarios automatically.

Is there a built-in way to define default values for columns in colModel and have them applied both when grid.addRow is called and when data is added via copy-paste?

In summary, is there any plan to introduce a defaultValue option in the colModel that would also work in Copy+Paste scenarios?

Thanks

paramvir:
It's already answered here:

https://paramquery.com/forum/index.php?topic=4347.0

Navigation

[0] Message Index

Go to full version