Editor custom field plug-in updating multiple fields

Editor custom field plug-in updating multiple fields

smetolsmetol Posts: 8Questions: 2Answers: 0
edited December 2016 in Editor

So far I know that editor custom field plugin can read/write one database field. I have legacy database table with many columns named:
col_A1,col_A2,col_A3,col_A4,col_A5, col_B1,col_B2,col_B3,col_B4,col_B5,
```**** col_C1,col_C2,col_C3,col_C4,col_C5

I cannot change table design.
I am thinking about writing my custom field plugin with five input boxes floating left. How to write get/set methods, so value arrays are used, and multiple fields are get/set ?
Any advice is appreciated.

Replies

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin

    Do you know exactly how many columns there are and will be submitted - will it always be five? Generally speaking a single field on the client-side would be written to a single column in the database, but you could use setFormatters on the server-side to split the data up.

    Before I try to write any code to explain that further, what is being submitted by the client-side for that field? An array of objects? Can you show me an example? Or is it a single object that needs to be written to the table (I'm hoping the latter - it is a lot easier!).

    Allan

  • smetolsmetol Posts: 8Questions: 2Answers: 0

    Thank you for your advice, very valuable, I will give it a try during the weekend. If I fail, I will setup a demo page.

This discussion has been closed.