Author Topic: server-side control  (Read 2168 times)

omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 147
    • View Profile
server-side control
« on: October 26, 2017, 04:50:36 am »
Hello,

How do I implement the following code in the wrong lines.

Code: [Select]
if (XXXX.prkod == 0) {
$grid.pqGrid("addClass", {rowIndx: rowIndx,cls: 'ui-state-error'});
}

I use this: https://paramquery.com/pro/demos/editing_batch

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: server-side control
« Reply #1 on: October 26, 2017, 04:38:24 pm »
I'm not clear on your post and its title.

But if your question is how to flag invalid values, then validations are used for that.

e.g.,
Code: [Select]
validations: [
                        { type: 'minLen', value: 1, msg: "Required." },
                        { type: 'maxLen', value: 20, msg: "length should be <= 20" }
                    ]


omerix

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 147
    • View Profile
Re: server-side control
« Reply #2 on: October 26, 2017, 05:21:50 pm »
Hi, I do not want verification.

If it is an invalid "update" I want to add the line "ui-state-error" class.

If it is invalid, I understand the values called "changes.updateList".

I have to make a sentence like the following.

Code: [Select]
if (changes.updateList['PRKOD']!= 0) {
 grid.pqGrid("addClass", {rowIndx: rowIndx,cls: 'ui-state-error'});
}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: server-side control
« Reply #3 on: October 26, 2017, 06:51:55 pm »
There are 2 ways to call pq methods: https://paramquery.com/pro/tutorial#topic-methods

If grid is grid instance in your code, then it's

Code: [Select]
  grid.addClass({rowIndx: rowIndx,cls: 'ui-state-error'});