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 - mikep

Pages: [1] 2 3 4
1
Help for ParamQuery Pro / editorKeyPress - get current textfield value
« on: November 26, 2024, 03:06:21 am »
How to I get the current value from the grid cell using editorKeyPress?
I need to get the cell value, then make an ajax call with this value to return an array that will be used to populate the autoCompleteEditor.

editorKeyPress: function(evt, ui) {
   if (ui.dataIndx === 'my column name') {
 
       //how to I get the value in the text field?

  }



2
How can I update the filter so that only the values that are filtered are checked?

Why is Project2 checked?
https://jsfiddle.net/dwzyem3q/

3
The first column in my column group is a calculated column and I only want it to display when the column is collapsed.
Can you add the Javascript to this file so that the column "rollup" is hidden when the group is collapsed?

https://jsfiddle.net/ftjhrqum/

4
I need to open the Grid Fields selection dialog from a button click event instead on clicking on the column hamburger icon. How can this be accomplished?

5
Help for ParamQuery Pro / select vs autocomplete editor
« on: September 20, 2024, 06:59:35 pm »
When user clicks on a cell, I want a select list to pop up on click, like the books column in your example (when clicksToEdit =1): https://paramquery.com/demos/editing_custom
Can this be done with a select? In the example above the "Ship Via" requires an extra click.
If not, I can use the autocomplete, like books column. For autocomplete, how can I add a change event to detect the value that is selected?
Below is the change event that is working for the select, but not for autocomplete.

 ui.$editor.on('change', function () {
   selRow = ui.rowData
    if ($(this).val() == "<item1 selected>") {
    DoAction1())
   }
});

6
Help for ParamQuery Pro / Image in Header
« on: August 27, 2024, 01:30:53 am »
I'm defining a column like this, to get text and image in the header, but when looking at the fields filter for this column, the entire title (to include the span html) displays.
title: "<span title = 'Desc goes here'>Column Text <img src='Images/Info.svg' /></span>",

Is there another way to add a column with text + image, so that when you view the available fields to filter, the title excludes the html? In the case above it should only display "Column Text" in the fields filter.




7
Help for ParamQuery Pro / how to reset a 'select' column
« on: August 13, 2024, 06:07:57 pm »
For a select list like below, that is triggering an action on change,  after the item is selected I would like to clear the selected item and remove the red edit triangle that appears.
In other words, I'd like to reset the field after the item is selected. How could I do that?

                {
                    title: "Actions", editable: true, dataIndx: 'Action', width: 140,
                    editor: {
                        type: 'select',
                        options: ['', 'Edit Resource', 'Remove Resource'],
                        init: function (ui) {
                            ui.$editor.on('change', function () {
                                rowData = ui.rowData
                                rowData.Action = "";
                                if ($(this).val() == "Edit Resource") {
                                    EditResource(rowData);
                                } else if ($(this).val() == "Remove Resource") {
                                    RemoveResource(rowData);
                                }
                                $gridMyTeam.pqGrid('refresh');
                            });
                        }
                    },
                    cls: 'pq-drop-icon pq-side-icon',
                    render: function (ui) {return '<a style="color:blue;text-align:center" >Actions</a>'}
                },

8
For the following column, I need to format the selected row. I'm able to change cell data (below), but how can I format the selected grid row? I want to apply strikethrough text.

                {
                    title: "Actions", editable: true, dataIndx: 'Action', width: 140
                    editor: {
                        type: 'select',
                        options: ['', 'Edit Resource', 'Remove Resource'],
                        init: function (ui) {
                            ui.$editor.on('change', function () {
                                rd = ui.rowData
                                if ($(this).val() == "Remove Resource") {
                                    rd.ResourceName = "(Delete) " + rd.ResourceName
                                    rd.ResourceName.style('color', "red")    //this doesn't work, how can I format this row with strikethrough text? If that's not possible, how can I set font color to
                                   red?
                                }
                            });
                        }
                    },
                },

9
Help for ParamQuery Pro / Format cell for Summary
« on: July 15, 2024, 05:39:48 pm »
I need to format the summary for a cell to be either currency or number, based on row data. I'm able to do this dynamic logic for the cell, but how to do it for the summary. Attached is what I'm seeing.

10
Help for ParamQuery Pro / onChange of select
« on: July 11, 2024, 05:46:17 pm »
How can I trigger the onchange event of a select item to get the selected value and the rowData for that row? Should i use editor?

{
title: "Actions",
editor: { type: "select", options: ["","Action 1 for this row...","Action 2 for this row..."] }
}

11
Help for ParamQuery Pro / Conditional Formatting of Currency or PCT
« on: June 25, 2024, 05:09:48 pm »
I need to format a cell as currency or integer, based on the value of another column in the row.
I want to maintain the functionality that when the cell is selected to edit, the "$" is removed when editing the cell.

How would I do that?

12
When I use the "Range" option in the column filter, it's showing me the IDs (9,3,1,0) instead of the text. How to show the text (Division, Business Unit...)

                        editor: {
                            type: "select",
                            options: [{ "9": "Division" }, { "3": "Business Unit" }, { "1": "Portfolio" }, { "0": "Other" }],
                        },
                        render: function (ui) {
                            var option = ui.column.editor.options.find(function (obj) {
                                return (obj[ui.cellData] != null);
                            });
                            return option ? option[ui.cellData] : "";
                        }

13
Help for ParamQuery Pro / Rotate column headers 90 degrees
« on: May 14, 2024, 06:30:59 pm »
Hi, How can I rotate the header text for a few columns (not all) by 90 degrees? Also, after I rotate, the column width will need to be thinner. It seems when I change the width past a certain value, it doesn't change. Is there a minimum?

14
Help for ParamQuery Pro / Formulas
« on: April 03, 2024, 02:29:43 am »
From a field formula, I need to return a value, which is calculated by getting the sum of a field ("aaa") for all rows where a field "bbb" is less than the current row's "bbb" value.
I don't know how to iterate the grid rows from a formula, to compare the values to the current rows values.

formulas: [
  ['MyCalField', function (rd) {

  return [calculated value]
  }
]


//this doesnt work in a formula:
                        var grid = $gridMain.pqGrid('instance');
                        var selCount = 0;

                        grid.Selection().eachRow(function (rowData, rowIndx) {
                            selCount += 1;
                        })

15
I'm able to change the summary type when the grouping column changes using the groupChange below.

                    groupChange: function () {
                        var GMDI = this.option('groupModel.dataIndx');
                        if (GMDI.indexOf('res') == 0 ) {
                            this.getColumn({ dataIndx: '% Allocate' }).summary = { type: 'sum' };
                        }
                        else {
                            this.getColumn({ dataIndx: '% Allocate' }).summary = {};
                        }
                    }

How would i implement similar logic after I apply a grid state: $gridMain.pqGrid("loadState", { state: result }, false);
//now set the summary type for columns, based on grouping in the state



Pages: [1] 2 3 4