Author Topic: In the demo Editors & validations,there is no limit-in-list for value in select  (Read 667 times)

hyh888

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 142
    • View Profile
In the demo Editors & validations(https://paramquery.com/pro/demos/editing_custom), for column ShipVia2 there is no limit-in-list for value in select. Would you like to help to show how to make? And use Ctrl+v, user can copy almost any unexpected data to select(s) and save them to database by batch(When user does this, there is only blank in select, in fact the data has be stored in value of select). Is there a solution for it? Here is the code from demo:

          {
              title: "Shipping Via2", dataIndx: "ShipVia2", width: 110,
              cls: 'pq-dropdown pq-side-icon',
              editor: {
                  type: 'select',
                  init: function (ui) {
                      ui.$cell.find("select").pqSelect();
                      setTimeout(function () {
                          ui.$cell.find("select").pqSelect('open');
                      })
                  },
                  options: [                       
                        { "SE": "Speedy Express" },
                        { "UP": "United Package" },
                        { "FS": "Federal Shipping" }
                  ]
              },
              //render required to display options text corresponding to value stored in the cell.
              render: function (ui) {                 
                  var option = ui.column.editor.options.find(function (obj) {
                      return (obj[ui.cellData] != null);
                  });
                  return option ? option[ui.cellData] : "";
              }
          },
« Last Edit: January 30, 2022, 06:11:54 am by hyh888 »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
I've updated the demo for in list validation of ShipVia2 column, please recheck.

hyh888

  • Pro Enterprise
  • Full Member
  • *
  • Posts: 142
    • View Profile
Many thanks for new demo. But if developer forgets setting limit-in-list for pqSelect, user in browser client maybe mistakely copy a lot of unhoped data to pqSelect column and save into database,for the value of select is changed but its text show nothing and these trouble-data will never be showed in interface in the future.
Maybe this should be treated as a bug.

By the way the configuration of pqSelect is a little complicated. Maybe it can be reduced to only configure one or two parameter instead of  dozens rows, unlesss user has very tricky requirement.
Maybe you can have a look for Jquery Easyui, even its grid function is not so powerful as pqGrid, but its style for easy-using impressed me deeply. Every line is for the need of business instead of software itself.
« Last Edit: February 01, 2022, 04:44:05 am by hyh888 »