Author Topic: about selection solution in batch editing  (Read 3118 times)

caoxp

  • Pro OEM
  • Newbie
  • *
  • Posts: 8
    • View Profile
about selection solution in batch editing
« on: June 06, 2018, 08:51:30 am »
Hello,
There are more than ten fields with selections as 'key_text' in our project. The text is relative with language. I want to save the key only in database, and see the 'key_text' in the grid on webpages. Can you give me some advise about it?

for example:
col: item category

selections:
key       text
a01      normal
b01      outside
c01      inside

I want to display as below in selection cells:
a01_normal
b01_outside
c01_inside
and save the key 'a01' in database.
Thanks.

Best regards,
John

 

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: about selection solution in batch editing
« Reply #1 on: June 06, 2018, 11:50:53 am »
I'm not sure about your meaning of selections w.r.to batch editing. Can you please share more details or a jsfiddle.

Are the fields displaying "a01_normal" read only or editable?

caoxp

  • Pro OEM
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: about selection solution in batch editing
« Reply #2 on: June 06, 2018, 12:29:01 pm »
for example: the books field in your demos 'Editors & validations'
for editing:
"A001_ActionScript",
"A002_AppleScript",
"A003_Asp",
"B001_BASIC",
I post the key as A001/A002 etc to database and not the value as ActionScript/AppleScript, because the value based on multi-language
So it get the key as A001/A002 from database, and how to display the value as "A001_ActionScript"

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: about selection solution in batch editing
« Reply #3 on: June 06, 2018, 01:02:52 pm »
If the fields "A001_ActionScript" are read only, then it can be simply displayed with help of column.render callback.

keep column with values "A001" as hidden and let's say it's dataIndx is "a"

column.render of  "A001_ActionScript" column.

Code: [Select]
column.render = function(ui){
   return ui.rowData.a + "_" + ui.cellData;
}
« Last Edit: June 06, 2018, 01:07:30 pm by paramquery »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: about selection solution in batch editing
« Reply #4 on: June 06, 2018, 10:57:34 pm »
Also the formulas can be used to keep correspondence between id ( hidden field ) and value fields.

as in this example:

https://paramquery.com/pro/demos/datamap

caoxp

  • Pro OEM
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: about selection solution in batch editing
« Reply #5 on: June 15, 2018, 08:49:49 am »
Thank you for help.
can you give some advice for multi-language based for the text of the selection field.
for the hidden id in those cells, there read the text based the login language in these cells. I want to commit it once to server on loading the grid.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: about selection solution in batch editing
« Reply #6 on: June 18, 2018, 09:19:50 am »
I'm not sure whether I've fully understood your requirements.

Please start creating as per the previous discussion and share a jsfiddle if you feel stuck somewhere.