Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - hyh888

Pages: [1] 2
1
When using fomula to input product code in column A and autumatically show product name in column B in sales order, somedays later, the name of a product is changed( in master data), in old sales order the old name should be expected to be show but in the  new created order the new name is expected to be shown. If formula is used, the old sales order will show the new name, even old name is recorded in the table of sales order lines in database. If there is a solution for this condition? 

In some case the price of product always changes, if using formula get price in database, it'll make trouble too, especially when there is redundance design in database table structure.
The price in interface will be different with price in database.
Any advice?

2
Wheng using following code to set default value for pqgrid column, there is a "Uncaught TypeError: Cannot redefine property: id"  problem.
The code comes from https://paramquery.com/forum/index.php?topic=4347.0.
            rowTemplate: {},
            complete: function(){
                let rt = this.option('rowTemplate'), cm = this.getColModel();
                cm.forEach(function(col){
                    let def = col.defaultValue, di = col.dataIndx;
                    if( def !== undefined ){
                        Object.defineProperty(rt, di, {
                            enumerable: true,
                            get(){
                                var val = this[ "_" + di];
                                return val == null? def: val;;
                            },
                            set(val){
                                this[ "_" + di ] = val;
                            }
                        });
                    }
                });
            },

3
Bug Report / Too many item in select, make select editor out of function
« on: October 27, 2022, 01:32:45 pm »
If there are 5 or 10 items in select, pqgrid runs well, if there are 40 items or more in select editor, the select couldn't dropdow.
I'm using this way to bind data:
                    options: [
                        { "SE": "Speedy Express" },
                        { "UP": "United Package" },
                        { "FS": "Federal Shipping" }
                    ],
Here is part of my code:
        var arrSelect = new Array(["/admin/codegen/tablesAutocomplete?datasource=main", 'mainTableName','name','name' ]
                                ,["/admin/permission/dataAll", 'permissionId' ,'id','title']
                                ,["/admin/permission/options", 'pid' ,'id','title']
                                );
        var obj = {
            height: 300,
            colModel:gridColModel,
                width:1700,
            stripeRows: false,
            saveUrl:saveUrl,
            pageSize:pageSizeHyh,
            create: function (evt, ui) {
                    var grid = this,column;
                   
                    $.ajaxSettings.async = false
                    arrSelect.forEach(function(item){
                            $.getJSON(item[0], function (response) {
                                    column = grid.getColumn({ dataIndx: item[1] });
                                    var a = new Array();
                                    var remoteData=(response.data.list?response.data.list:response.data);
                                    if(remoteData==undefined ||remoteData== null) return;
                                    for(let j=0,len=remoteData.length;j<len;j++){
                                            var myObj={};
                                            myObj[remoteData[j][item[2]]]= remoteData[j][item[3]];
                                            if(j<30)
                                                      a.push(myObj);
                                    }
                                    column.cls='pq-drop-icon pq-side-icon';
                                    column.editor={
                                            type: 'select',
                                            options: a,
                                           
                                            init: function (ui) {
                                                    ui.$cell.find("select").pqSelect();
                                                    setTimeout(function () {
                                                    ui.$cell.find("select").pqSelect('open');
                                              })
                                            }
                                    };
                                    column.render=function (ui) {
                                            var option = ui.column.editor.options.find(function (obj) {
                                                    return (obj[ui.cellData] != null);
                                            });
                                            return option ? option[ui.cellData] : "";
                                    }
                            });

                    });
                    $.ajaxSettings.async = true;

                this.widget().pqTooltip();
            },


When I debug it, I find datasoure of select editor is OK, but they couldn't be show in browser. The reason is that too many items make select editor  too long and out of the interface.  But I couldn't find the solution.

4
When the name of a product is changed, in old sales order the old name should be expected to show but in the  new created order the new name is expected to show. If formula is used, the old sales order will show the new name, even old name is recorded in the table of sales order lines in database. If there is a solution for this condition?  Is there afterchanged and afterupdated for pqgrid cells?

5
Help for ParamQuery Pro / Readonly grid
« on: May 17, 2022, 08:28:39 am »
Would you like to show me how to make pqgrid a readonly spreadsheet conveniencely?
Now I have to set editable property as false one col by one col.

6
In the code of demo, I didn't find the code for saving envent.Would  you like to provide save event sample code for treegrid batch editing?
When I use saving mothod of common grid, pqGrid send json of all records to server when I changed the topnode. It seems that the item property of json is unnesassary.

Here is the json that pqGrid sent to server:
{"oldList":[{"sn":"ZJL"},{"sn":"SCYYZJ"}],"save":[],
"update":[
{"eachLevel":1,"id":"3"
,"items":[{"eachLevel":2,"id":"5"
,"items":[{"eachLevel":3,"id":"6"
,"items":[{"eachLevel":4,"id":"7"
,"items":[{"eachLevel":5,"id":"8","name":" Planner ","pid":"7","sn":"SCJHY","pq_level":4,"parentId":"7","pq_ri":4,"pq_hidden":false,"pq_ht":35}]
,"name":" Planning Supervisor ","pid":"6","sn":"SCJHZG","pq_level":3,"parentId":"6","pq_ri":3,"pq_hidden":false,"pq_ht":35}]
,"name":" Planning Manager ","pid":"5","sn":"SCJHJL","pq_level":2,"parentId":"5","pq_ri":2,"pq_hidden":false,"pq_ht":35}]
,"name":" Operation Director","pid":"3","sn":"SCYYZJ2","pq_level":1,"parentId":"3","pq_ri":1,"pq_hidden":false,"pq_ht":35,"pq_cellcls":{"sn":"pq-cell-dirty"}}]
,"name":"GM","pid":"0","sn":"ZJL1"}
,{"eachLevel":2,"id":"5"
,"items":[{"eachLevel":3,"id":"6"
,"items":[{"eachLevel":4,"id":"7"
,"items":[{"eachLevel":5,"id":"8","name":"Planner","pid":"7","sn":"SCJHY","pq_level":4,"parentId":"7","pq_ri":4,"pq_hidden":false,"pq_ht":35}]
,"name":"Planning Supervisor","pid":"6","sn":"SCJHZG","pq_level":3,"parentId":"6","pq_ri":3,"pq_hidden":false,"pq_ht":35}]
,"name":"Planning Manager","pid":"5","sn":"SCJHJL","pq_level":2,"parentId":"5","pq_ri":2,"pq_hidden":false,"pq_ht":35}]
,"name":"Operation Director","pid":"3","sn":"SCYYZJ2","parentId":"3"}]
,"delete":[]}

7
Suggest new features / Default value in colModel
« on: May 12, 2022, 03:56:13 am »
Now it seems that default value couldn't be set in colModel for new row of every column. Can it be added?
Then developer may get better experience in programing like following:
var colModel= [
         {title: "ID", dataIndx: "id", width: 200,dataType: "string",  editable: false },
         {title: "Country", dataIndx: "Country",width: 260, dataType: "string",default:"USA"},
         {title: "City", dataIndx: "City",width: 260, dataType: "string",default:"New York"}
                     ]

8
Help for ParamQuery Pro / Head filter listenner
« on: April 28, 2022, 11:21:50 am »
In head filter, filter action is triggered when filterbox got change. Is it possible to trigger filter action when TAB or ENTER keys are pressed?
Could you like to show me how to intercept the listenner of head filter change envent

9
Help for ParamQuery Pro / How to shrink size the delete button
« on: January 31, 2022, 11:10:53 am »
I have tried to shrink the size of delete button to reduce the height of every row, but got failed even tried many times.
Is there any solution for it?

10
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] : "";
              }
          },

11
I hope to add new row automatically, when the DownArrow Key is pressed in the last row.
Following code works well when there is no filter used. But after filtering, pressing DownArrow Key couldn't add new row automatically when the cell in last row is selected. Would you like to provide help kindly?

              beforeCellKeyDown: function( event, ui ) {
                if(event.key=="Delete" ){
                var nodes = [];
                var type = this.Selection().address()[0].type
                if(type == 'row'){
                   var Sel = this.Selection().eachRow(function(rowData){
                     nodes.push(rowData);
                   })
                   this.deleteNodes(nodes);
                   return false; //to prevent default behaviour.                    
                }             
      
            }                   
                 if(!this.isValid( { rowData: ui.rowData } ).valid)
                      {return;}
                if(event.key=="ArrowDown" && ui.rowIndx==this.getTotalRows()-1){
                        var rowIndx = this.addRow({ rowData: defaultRowData(), checkEditable: true });
                        // this.goToPage({ rowIndx: rowIndx });
                        debugger;
                        this.editFirstCellInRow({ rowIndx: rowIndx });   
      
                }
           
             },

12
Help for ParamQuery Pro / How to add new option or event in grid
« on: December 27, 2021, 07:42:09 am »
To saving code and reduce bugs, I hope to add saveUrl(url to save data) and getUrl(url to get the json data) for grid, and also hope to add inbuild SaveChanges event to grid for saving data with saveUrl.
Would you like to provide help?
Thank you very much.

13
Help for ParamQuery Pro / cell get focus event
« on: December 01, 2021, 05:35:13 pm »
Would you like kindly show me how to get cell value when a cell get focus whenever using keyboard or mouse?

14
Bug Report / TAB doesn't work in select editor
« on: November 24, 2021, 05:03:21 am »
In select editor of  pqgrid demo, when TAB is pressed, the next cell will get focus.  But in my code, TAB doesn't work. Would you like to tell me which css or js file will effect on it? I will add them.
For pqgrid confilicts with bootstrap 4.6.0(make a lot of trouble) ,I have to remove it from my project. But in the demo, I find bootstrap3 is imported. Is this the reason?

15
Bug Report / Copy and paste problem
« on: November 22, 2021, 02:20:41 pm »
When I add a new row in grid and let editor open, then copy data of another row(Ctrl+C) to the new-added row((Ctrl+V), the cells with delete buttons all lost there style(css and the scissors disappeared). If you click the delete button in the cell, the delete function could not work. But when rows  overflow the grid, the problem will not come out, you'd better set the height of grid is 600 and place less than 8 records in the grid to keep enough place in the grid for the new row.
The screen-shot are as follow:

Pages: [1] 2