logo
down
shadow

How to pivot columns in free jqgrid 4.15.4


How to pivot columns in free jqgrid 4.15.4

Content Index :

How to pivot columns in free jqgrid 4.15.4
Tag : jquery , By : quicky
Date : November 25 2020, 07:06 PM

it helps some times What you are describing cannot easely be achieved using the jqPivot feature, as the data structure you are showing doesn't seem to follow a specific rule (some records contain value for one cell, while other records have values for two cells).
It seems that you only need to display one record with its values split on two lines, without much need of the features ofered by jqGrid, in which case I would recommend not using a grid plugin, but simply creating the DOM manually.
var dataConverted = convertData(data); //Convert your custom data to the structure of colModel

$('#grid').jqGrid({
    //...
    datatype: "local",
    data: dataConverted,
    colModel: [
        {name: 'deadlineType', label: 'Deadline'},
        {name: 'deadlineValue', label: ''},
        {name: 'daysLeftType', label: 'Days left'},
        {name: 'daysLeftValue', label: ''},
        {name: 'participantsType', label: 'Participants'},
        {name: 'participantsValue', label: 'Total'},
        {name: 'qaPassed', label: 'QA passed'}
    ]
});

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How to show all columns in column context menu in free jqgrid


Tag : jquery , By : beebob
Date : March 29 2020, 07:55 AM
like below fixes the issue I posted updated version of jquery.jqgrid.showhidecolumnmenu.js to the github. It should solve the described problems.

How to fix Cannot read property 'cellIndex' of undefined dragging from one jqgrid column to other in free jqgrid


Tag : javascript , By : Jaya
Date : March 29 2020, 07:55 AM
I hope this helps you . It seems to me that you have to change your code a little. You should always test that you call $.jgrid.getCellIndex with DOM of
element and not with some other children of it. The code fragment of typical usage of $.jgrid.getCellIndex should be the following:
var $td = $(e.target).closest("tr.jqgrow>td");
if ($td.length > 0) {
    var iCol = $.jgrid.getCellIndex($td);
    ...
}

How to do natural sort/alpha numeric sort over columns for y-dimension in jqGrid pivot table


Tag : development , By : Habikki
Date : March 29 2020, 07:55 AM
Hope that helps Free jqGrid 4.9 contains full rewritten version of jqPivot. I tried to hold compatibility with the previous version, but it contains many advanced features. I tried to describe there in wiki.
Not so many people uses jqPivot. So I remind what it do. It gets an input data as source and generate new data, which will be input data for jqGrid. Additionally jqPivot generates colModel based on input data and yDimension parameter. During analyzing of input data jqPivot sorts input data by xDimension and by yDimension. The order or sorting of xDimension defines the order of rows of resulting grid. The order or sorting of yDimension defines the order of columns of resulting grid and the total number of resulting columns. The options compareVectorsByX and compareVectorsByY of allows to specify callback function which will be used for custom sorting by the whole x or y vector. It's important to understand that sorting function not only specify the the order of columns, but it informs jqPivot which vectors should be interpreted as the same. For example it can interpret the values 12, 12.0 and 012.00 as the same and specify that 12.0 is larger as 6.
yDimension: [
    { dataName: "sellyear", sorttype: "integer" },
    { dataName: "sell month",
        compare: function (a, b) {
            if (a === "Germany") { return b !== "Germany" ? -1 : 0; }
            if (b === "Germany") { return 1; }
            if (a > b) { return 1; }
            if (a < b) { return -1; }
            return 0;
        }}
]
compareVectorsByY: function (vector1, vector2) {
    var fieldLength = this.fieldLength, iField, compareResult;

    if (fieldLength === 2) {
        if (vector1[0] === "2011" && vector1[1] === "Germany") {
            if (vector2[0] === "2011" && vector2[1] === "Germany") {
                return {
                    index: -1,
                    result: 0
                };
            }
            return {
                index: vector2[0] === "2011" ? 1 : 0,
                result: -1
            };
        }
        // any vector1 is larger as vector2 ("2011", "Germany")
        if (vector2[0] === "2011" && vector2[1] === "Germany") {
            return {
                index: vector2[0] === "2011" ? 1 : 0,
                result: 1
            };
        }
    }

    for (iField = 0; iField < fieldLength; iField++) {
        compareResult = this.fieldCompare[iField](vector1[iField], vector2[iField]);
        if (compareResult !== 0) {
            return {
                index: iField,
                result: compareResult
            };
        }
    }
    return {
        index: -1,
        result: 0
    };
}

Free-JQGrid: On Inline edit, the height of frozen columns is not matching with other columns


Tag : development , By : Tamizhvendan
Date : March 29 2020, 07:55 AM
hop of those help? Thank you for the bug report. I committed the fix of the problem to GitHub. Now the demo works correctly.

Free jqGrid - Showing/Hiding columns if empty


Tag : jquery , By : Jet Thompson
Date : March 29 2020, 07:55 AM
hope this fix your issue It's better to use beforeProcessing to analyse the data returned from the server. The code of beforeProcessing will heavy depend on the format of data returned from the server. Below is an example of beforeProcessing:
beforeProcessing: function (data) {
    var i, foundPrescription = false;
    if (data.rows != null) {
        for (i = 0; i < data.rows.length) {
            if (data.rows[i].prescription) { // if not empty string
                foundPrescription = true;
                break;
            }
        }
        $(this).jqGrid(foundPrescription ? "showCol" : "hideCol", "prescription");
    }
}
Related Posts Related QUESTIONS :
  • Exclude one or more elements from being connected (using connectWith) in jQuery's sortable lists
  • Adding link with existing href
  • jquery cycle plugin divs always stacked problem
  • jquery toggle and fade in one function?
  • JQuery UI Tabs caching
  • Drag and Drop into another div and move in the div only using jquery
  • Links in rounded boxes? In ALL browsers (yep included IE8)
  • How to change the content of the Span using jQuery?
  • jQuery; combine user click and :checked
  • jQuery - Finding the element index relative to its container
  • jQuery .each() function. Resetting the index?
  • jQuery storing settings
  • Why does asp.net mvc form submits itself on button clicks when javascript function error?
  • Linking to non-home panel in JQTouch site
  • How to Edit jQuery Table Using CSS
  • Jquery hover triggers "mouse leave" without cursor leaving
  • DELETE http://localhost:8000/product/[object%20Object] 500 (Internal Server Error)
  • Comparing two string arrays and returning key of not found element using jquery
  • using jquery to change list items is changing all list items, when i want to only change one list item
  • Sending a Json data from my html page to a php
  • Click function to search a specific element in a Json object
  • Bootstrap 4 - Progress Bar Progression
  • how to deleted item materialize chips
  • jQuery - Hide non-active elements using filter()
  • Adding style to string table is not working
  • Github merge multiple files into single compressed master file
  • Replace characters in a field on page load
  • Unable to send data from Form to SQL database
  • If all divs have same style, remove element
  • How to click a jQuery Dialog button in TestCafe
  • Cannot reinitialise DataTable with Angular Datatable
  • How to add Class active on Click in Navbar
  • how to call fail method into jquery.get/post success method?
  • Slider with tabs
  • Jquery Get parent element from data function
  • Ho to put a new line in <p> tag in my jquery?
  • How can I use a text value as a mathematical operator?
  • DataTable columns values showing Only DefaultContent
  • JQuery select dynamically added elements
  • How to change an image source on hover?
  • How to bind jquery event to dynamically added multiple DOM elements?
  • How to get td values and store in array using Jquery?
  • How to add handler to dinamically created tr in JQuery?
  • How to Covert Html to PDF in Jquery?
  • Jquery before() and after() used to create a <div> container not inserting closing tags in after()
  • I want to delete previously added class
  • Open html page in same window after clicking on navlink
  • Datatable is not working when I populate table using smarty
  • How to change image based on the offset top of the content div
  • Find the index of table column with specific id
  • How to return value of $(window).resize()
  • How to optimize adding numerous elements dynamically into web page
  • Content slide down on top of page?
  • How to write if statement for when a specified option is selected in select tag in JQuery
  • HTML tags remove from textarea using jQuery
  • ShareThis not display properly when initially hidden
  • jquery - Bind datepicker event
  • How can I cause an element to move on mouse scroll using transform matrix?
  • How to add Custom summaries for autogenerated colums?
  • How to update table row with data from an array using jQuery
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com