JqGrid rowNum in pagination not working right - jqgrid

...
rowNum: 10,
pager: '#mypager',
rowList: [10,20,30]
...
In a table that has more than 10 records, it shows them all and says page 1 of 0, even though the rowNum is set to 10. If I choose from the drop-down list 20 than it shows the correct number, even if I select 10 afterwards it again shows the right number of rows. But not on the first visit. Why is that?

Calling this solves the problem:
jQuery("#tableToGrid").setGridParam({ rowNum: 10 }).trigger("reloadGrid");

Sounds like the initial property isn't getting set correctly, try deleting out the line and redoing it?
rowNum: 10,
rowList: [10, 20, 30],

I suppose that you fill the grid in a wrong way. For example if you would use addRowData you can include more rows as the value of rowNum.
In any way you should include more full code which you use to create the grid and describe how you fill the data in the grid.

Related

PowerBI Sorting numbers as text instead of numerically [SOLVED]

PowerBi community - help!
I have a heatmap of product failures based on product characteristics. Right now my matrix is sorting my rows incorrectly. Right now from top to bottom, it is reading 1000, 105, 110, 115, 120, 1200, 1250, 130... and I want it to be in the order of 105, 110, 115, 120, 130, 1000, 1200, 1250. I do have these values as "whole numbers" in my data table. But it seems like it is sorting them alphabetically. Thank you for any tips you have!
Product failure heatmap
Data table
edit: Solved - I had to unpivot my data at one point, and when I made my feild parameters I accidentally used my unpivoted data. Therefore, it was using my unpivoted data type of "text." I was able to re do my feild parameters using my original data - and this solved the issue.
Feild parameters unpivoted -> text
fixed heatmap

Ensure value labels are displayed

I want to keep value labels outside my amChart graph. The problem is that when value label value is over 9999 then I cant display it's all content.
In this example values should be:
25,000
20,000
15,000
10,000
5,000
First digit is missing. I am dealing with this only by setting panel's margin
"panelsSettings": {
"marginLeft": 40,
"marginRight": 20,
},
Is there any more convienient way to be sure that labels are fitting? hardcoding margin seems to be overkill.
This is my example chart: https://jsfiddle.net/29w35txy/1/
As I mentioned in the comments above, it seems that this issue is depending on the default Browser font.
So it is working in Chrome (left), but does not work in Firefox (right) for me:
Beside that you can prevent this by increasing marginLeft of your panelsSettings which you are already using:
"panelsSettings": {
"marginLeft": 60,
// ...
},
Here I forked you fiddle to show the result.

Query a Chart with C3.js

I created a simple pie chart with around 10 items (using C3.js and D3.js). Now, in a second visualization (a table) I want to know the colors of each of the items, to also represent them in the table.
Is it possible to query the chart to receive the item's name and color?
I know I can manually hardcode colors for items and just use the same colors. However, this is not applicable in my case, as the items in the pie chart vary greatly (and I don't know them yet, as it is dependent on the user), hence my question.
Quick look at the source code reveals that you are correct, it's a category10().
Further it retrieves them by a key of "data id", which appears to be the first "column" in it's data input format:
columns: [
['data1', 30, 200, 100, 400, 150, 250], //<-- data1 is id
['data2', 130, 340, 200, 500, 250, 350]
]
You can inspect which are used by:
> chart.internal.color('data1')
"#1f77b4"
> chart.internal.color('data2')
"#ff7f0e"

Show Grid As Static Height In JqGrid..?

I have a grid that contain 25 records, in page size property i set to 10 records per page , then i will have 3 pages in the final page it displays only 5 rows, Here i want to show
10 rows. (First five records then next five as empty rows)
Please help me.Thanks in advance
Your question is not full clear because you don't posted the JavaScript code which you use. Typically one use either
rowNum: 10,
height: "auto"
or
rowNum: 10,
height: 230, // 23px for a row
scrollOffset: 0

How to remove right bottom pager text from jqgrid

In jqgrid, I want to remove text appearing on pager i.e. View 1 - 2 of 2.
all other things are fine on pager.
My grid/pager is as follow:
<table id="GrdList">
</table>
<div id="GrdPager">
</div>
for pager:
rowNum: 5,
rowList: [5, 10, 20],
pager: '#GrdPager',
Can you please guide me how to remove appearing text on right bottom corner i.e. View 1 -2 of 2 (current page and its records).
Thanks
You should remove viewrecords: true option from your jqGrid.

Resources