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.


Messages - joaosales

Pages: [1] 2
1
Help for ParamQuery Pro / Using Formulas in multiple Columns
« on: March 19, 2018, 03:44:22 pm »
Hi,

is there a way to set a set the same formula as dataIndx for multiple columns, but have the formula use a condition depending on the column?
example:
Code: [Select]
["RandomFormula", function(ui){

                    var total = 0;

                    for (var k in ui) {

                        if (!isNaN(ui[k])) {
                            if (k.indexOf("-") > 0) total += ui[k];
                        }
                    }
                   if(column X) total = total/10;
                   if(column Y) total = total*10;
}]

I'm trying to build the table dynamically , so i would need extra information about the column, other than the dataIndx, to know how to calculate.

Thanks,

2
ParamQuery Pro Evaluation Support / Excel Formula for columns
« on: March 15, 2018, 06:15:27 pm »
Hi,

I would like to create a table based on some customization that I read from a json and one of the things i would like to do is  associate a column with an excel formula,
so for example, i would define 3 columns (A,B,C) and would  have info saying that column C is SUM(A[row];B[row]).
I know you can use formulas and create a function based on the ui rowData, but i would like to know if it is possible to pass a excel formula as the dataIndx for a column.


Thanks,

3
Help for ParamQuery Pro / Re: Missing style while packing
« on: February 28, 2018, 02:45:59 pm »
If I select the inner div the pqgrid.ui.min.css also show in the styles

4
Help for ParamQuery Pro / Re: Missing style while packing
« on: February 28, 2018, 01:07:03 am »
Well, thats what i thought. But when I debugged right after the grid is build i can see that it finds some of the grid css.
So I'm really lost here  :(

5
Help for ParamQuery Pro / Missing style while packing
« on: February 27, 2018, 03:14:41 pm »
Hi,

I'm starting to use webpack in my solution that uses the grid. For now I was only trying to pack my on code and loading css and the grid js at the html imports.
The grid is build gets all the data and all, but when the page is load the style is broken and all the columns seems to be stacking together at the first position of the grid.
Do you have any ideas what could help to fix this?


6
Help for ParamQuery Pro / Re: Refreshing columns and data
« on: February 19, 2018, 10:22:11 pm »
Hi, im with a problem related to what i was doing here
I fixed to use the refreshCM and it worked like planned. But I have now a checkbox column mapped to true/false values
Code: [Select]
{
                title: "Total",
                dataIndx: "sumRow",
                type: 'checkbox', //required property.
            }

and every time i use the buttons that refresh the colModel the column stops being a checkbox and only show true and false values.

7
Help for ParamQuery Pro / Automatic copy values
« on: February 08, 2018, 05:20:30 pm »
Hi,

Is there a easier way to copy data from one cell to the rest of the cells of columns after, in the same row?
For now i was doing inside the change event. Whenever a value is changed, i get the

ui.updateList and the values at newRow and rowData and copy the value in newRow to the remaining columns at rowData.

and then $grid.pqGrid("updateRow", { 'rowIndx': updatedRowIndx , row: rowData })

Code: [Select]
function UpdateColumns( event, ui ) {
            let changes = ui.updateList[0];
            let rowChange = changes.newRow;
            let newRow = changes.rowData;
           
            //get updated cell and loop at newRow changing the value of the other columns

            this.updateRow({ 'rowIndx': changes.rowIndx , row: newRow });
}

Update the question with the code because it didn't actually work :(

Thanks

8
Hi,
I've being trying to build a new simple grid to test some features but i seem to run at a problem I can't  figure.
Whenever the code gets to the point of building the grid:
pq.grid("#grid_data", obj);

I get this error message

jQuery.Deferred exception: Cannot set property '_renderG' of undefined


And the grid appears compressed at the page and with no data loaded.

9
Help for ParamQuery Pro / Re: Format specific cell/row
« on: January 30, 2018, 07:43:59 pm »
For some items I already have the format symbol when build the grid, but for others I'll only get it after setting the the value at the currency cell of the row.
For now I tried setting at the postRender of the currency dropDown column, but it isnt changing the format, can you help me finding what's wrong or it doesn't work at the postRender?

Code: [Select]
postRender: function(ui){
                        let dataColumns = {};
                        let currencySymbol =getCurrency(ui.rowData.currency);
                        for(var colIdx in ui.rowData){
                            dataColumns[colIdx] = currencySymbol+"##.###,00";
                        }
                        ui.rowData.pq_format = dataColumns;
                }

Thanks,

10
Help for ParamQuery Pro / Format specific cell/row
« on: January 30, 2018, 01:44:07 pm »
Hi,
How can I format a specific cell or an entire row? I've been able to change the format of a column, during the event of changing a value of a cell, but i haven't been able to apply the same thing for an entire row.
Right now i have a  column where you choose a currency in a dropdown list, and i would like to apply that currency symbol to the values in the row.


Thanks,

11
Help for ParamQuery Pro / Checkbox column radio option
« on: January 29, 2018, 07:25:00 pm »
Hi,
I saw at a different topic someone asking about the  option to check only one box in a column and the answer was to use the radio:true option, but how do we build the column?
As a normal Checkbox type? I've done like this but i'm still able to check multiple rows

 
Code: [Select]
            {
                title: "Total",
                dataIndx: "sumRow",
                type: 'checkbox',
                cb: {
                    radio: true,
                    check: "YES", //check the checkbox when cell value is "YES".
                    uncheck: "NO" //uncheck when "NO".
                },
            }

Thanks!

12
Help for ParamQuery Pro / Re: Grandsummary
« on: January 25, 2018, 03:05:44 pm »
Thanks so much for the help. It works like a charm now!!

13
Help for ParamQuery Pro / Re: Grandsummary
« on: January 24, 2018, 01:43:32 pm »
Hi,

I still don't think of a way to make it work with aggregate and formulas together, since the weight is only applied to the summary row
and i dont have fixed dataIndx for the columns, they are mapped depending on year/month, and i can change the view of the table using
a button/filter, to show me a different year.

And example of the data i have is like this, the default currency is Euros, so its values are 1 for all months. And the other
currencies are based on it. On the Grid table, each row can have a different currency, and the second column, specifies which currency
by name, allowing me to match with the name of a currency in the first column of the currencies table.
So the weight is only applied when I want to calculate the Summary for the grid table.



Currencies Table
   oct    nov    dec   
eur   1      1     1
usd  0,8    0,8   0,8   
dkk  0,2    0,2   0,2



Grid Table

                      2017
          oct   nov  dec     total
item1 eur  10   15   20       45
item2 dkk  40   40   40      120
item3 usd   5    5    5        15
Total EUR  22   27   32       81    < - only row where the weight is applied (and calculate the sum of each element in the column*weight)
         
         
From what i could understand, formulas are mapped by the dataIndx of a column,and if I use this i wouldnt be able to load the values.
And when in a formula i only have the row info, the same way as in a aggregate function i only have the column info. If there is a way, how could i combine
both? would really like if you have a working example on this.

Later I will try to create a smaller version of my grid on plnkr  and post here, to help the understanding.

Thanks so much for the help so far, and sorry for all the trouble.

14
Help for ParamQuery Pro / Re: Grandsummary
« on: January 23, 2018, 07:01:05 pm »
I guess instead of describing how I'm trying to solve my problem, Ill describe the problem, maybe it'll work out better.

I'm using the grid to collect financial data, each row has a different currency assigned to it. and I have a conversion rate for each column.

Basically, this means that each cell has a different weight to it and this weight is stored in an external data source, in memory.

what I want to do for my aggregate formula, is to lookup in this external source the weight for the current cell and multiply it (weight[row][colum] * cellValue). The calculated value needs to be displayed only in the summaries, which uses the system default currency.

What is the best way to do this?

Thanks for all the help!

15
Help for ParamQuery Pro / Re: Grandsummary
« on: January 23, 2018, 03:46:19 pm »
I'm trying with custom aggregates now, but I would still need some extra info, like the rows that are used to find out which weight to apply, the functions get an array and the column, is there a way to know the rows too?
i cant simple use the position on the array because i have groups on the table.

Pages: [1] 2