Recent Posts

Pages: 1 [2] 3 4 ... 10
11
for the already filled rows
I am able to see all the columns listed in variable  mMajor[0/1/2 row ].  i am getting all the fields. but for the newly inserted only the values specified fields are listing.

please point out where i am missing.
12
Help for ParamQuery Pro / Re: custom summation?
« Last post by paramvir on August 26, 2024, 05:42:42 pm »
Let's simplify it.

If the 1st value ( numerator ) is variable and 2nd value ( denominator ) is fixed, then you can keep numerator in the data and display denominator in column.render callback.

Code: [Select]
column.render = function(ui){
   return ui.cellData + "/10%";
}

This way only numerator would be shown in the editor when cell is edited.

And to compute values in a column depending upon corresponding values in other columns of same row, please use any of the following examples to set up column dependency.

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

https://paramquery.com/pro/demos/rowtemplate
13
Hi This is the function I have writtten in cellSave ( modified from EditorEnd )         

editor: {
                            type: 'select',
                            attr: 'multiple',
                            labelIndx: 'description',
                            valueIndx: 'lcid',
                            init: function (ui) {
                                if (ui.dataIndx === 'noofwiresahead' || ui.dataIndx === 'noofwiresback') {
                                    refresh_noof_wires(ui.rowData.conductortype_left);
                                }
                            },
                            getData: function (ui) {
                                return ui.$cell.find("select").val();
                            },
                        },

    .....


 function fn_Major_cellSave(event, ui) {

                if (ui.dataIndx === 'caseid') {
                    if (ui.rowData?.caseid !== null && ui.rowData?.caseid !== "" ) {
                        fn_major_caseid_selection(ui);
                       // this.refreshRow({ rowIndx: ui.rowIndx });
                        return;
                    }
                }

             ....
}


    function fn_major_caseid_selection(ui) {

                var optionvalues = ui.rowData.caseid;
                var optionvaluesarr = optionvalues.split(",");
               
                ui.rowData.caseid = optionvaluesarr[0] ?? null;
               
                var mWire=$("#grid_wire_details").pqGrid("option", "dataModel.data");
                var mMajor = $("#grid_MajorLoading_details").pqGrid("option", "dataModel.data");

                for (i = 0; i <= optionvaluesarr.length - 1; i++) {
                    for (j = 1; j < mWire.length; j++) {
                        if (i == 0 && j == 1) { //If Multiple Selections done, then 1
                            ui.rowData.conductortype_left = mWire[j].ahead_name;
                            ui.rowData.conductor_left_right_details = 'Identical';
                            continue;
                        } else {
                            mMajor.push({});
                            mMajor[mMajor.length - 1].casid = optionvaluesarr;
                            mMajor[mMajor.length-1].conductortype_left = mWire[j].ahead_name;
                            mMajor[mMajor.length-1].conductor_left_right_details = 'Identical';                         
                            //$("#grid_MajorLoading_details").pqGrid("addRow",
                            //    {
                            //        newRow: {},
                            //        refresh: true
                            //    }
                            //);
                        }
                    }
                }

                //$("#grid_MajorLoading_details").pqGrid("option", "refresh")
                $("#grid_MajorLoading_details").pqGrid("option", "dataModel.data", mMajor);
                $("#grid_MajorLoading_details").pqGrid("option", "refreshDataAndView");
                reserial_majorloding_grid();
                fn_Major_set_default_values();
                $("#grid_MajorLoading_details").pqGrid("option", "refresh")
               
                //$("#grid_MajorLoading_details").pqGrid("option", "refreshDataAndView");


            }

Not adding rows and reserial and default values

But if i do operation another time / any other operation. then the inserted rows gets reflected.

Suggest a event for proper updation.
14
init: function (ui) {
                                        let selOptions = ui.cellData.split(',').map(Number);
                                        var $select = ui.$cell.find("select");
                                        console.log(ui.$cell);
                                        $select.pqSelect({
                                            checkbox: true,
                                            multiplePlaceholder: 'Select Insulator',
                                            width: '100%',
                                           
                                        });
                                        //let selOptions = [1, 2];
                                        $select.val(selOptions);
                                        $select.pqSelect('refreshData');//
                                       
                                    }

able to set the cell values to the select list options as selected.

Thanks for your support
15
Help for ParamQuery Pro / custom summation?
« Last post by markn on August 24, 2024, 01:29:31 am »
I am going to try and explain this as best I can and provide an image that I hope will help explain it as well.  In each cell of my grid I have some custom html that actually has two different values in it.  If you look at the image you will see 10 /10% in row 5.  The second value is always static; it is set when the grid is loaded and cannot be changed by the user.  However, the first value can be changed. Using the example above a user could type in 37 and you would see 37/10%.  What I need help with is to sum all of those first values and display that total in another cell.  In the image example, if I have two values on the same row 10/10% and 17/20%, in one column I would sum the first values (27) and in another column I would have the second value sum (30).
16
Help for ParamQuery Pro / Re: Row Height Wrapping Canceling
« Last post by paramvir on August 23, 2024, 03:25:20 pm »
cell wrapping works only in case of single line of text.

In order to set fixed height of rows irrespective of content, you can set autoRow to false.

https://paramquery.com/pro/api#option-autoRow
17
Hi,

thanks for the reply. the error gone( my faulty code )

but how to set the select list check boxes with the value present in the cell data. for a multiple values ( if the cell has value like '1,2'  , then 1 and 2 option should be selected ).
18
Help for ParamQuery Pro / Row Height Wrapping Canceling
« Last post by necatiozbek on August 23, 2024, 02:07:32 pm »
Hi;
I have a cell that contains very long text. Even though the wrapping is false in my object, the cell height increases.
How do I set a height that cuts the text inside

I want normal cell height that Cuts Text

var grid_chnotlari_obj = {
                    width: "auto",
                    height: "200",
                    showHeader: true,
                    selectionModel: { type: 'row', mode: 'block' },
                    wrap: false,
                    hwrap:false,
                    scrollModel: { autoFit: true },
                    collapsed: false,
                    colModel: [
                        {
                            dataIndx: "CREDATE", title: "Not.Tarihi", dataType: "date", format: 'dd.mm.yy',
                            width: "10%",
                        },
                       
                        {
                            title: "Not Başlık", dataIndx: "NOT_BASLIK"
                        },
                        {
                            title: "Not", dataIndx: "NOT_ACIKLAMA"
                        },

                        {
                            title: "Oluşturan", dataIndx: "CREUSER", width: 500, editable: false,
                            width: "10%",
                        },
                    ],
                    dataModel: {
                        data: []
                    },
                   
                };
19
In that case, it's pq_gtitle instead of pq_gsummary

Also change the column editor from static object to callback that returns object conditionally depending upon ui.rowData.pq_gtitle value.

Example of conditional editors is here: https://paramquery.com/pro/demos/editors_conditional

Please share a jsfiddle if still facing issues.
Pages: 1 [2] 3 4 ... 10