How to display headers for each group in jqGrid - asp.net-mvc

I am trying to use jqGrid to display tabular data in groups (shown in image below) and having trouble displaying headers for each group (as Hierarchical jqGrid displays columns headers for child grids). I have included how default jqGrid Grouping looks like.
Is there any way to implement this? Also is it possible to display summary in group header row instead of footer?
Thank you

What you want contains too many changes in the standard structure of the grid. I suppose that you want that the "Groups" header and sub-headers "Group Header 1", "Group Header 2", "Group Header 3" should be resizable. It seems me a little too difficult in the implementation.
Probably you should use better subgrids instead of data grouping? If you need hold the width of last columns of subgrids synchronous with the width of last columns of the main grid you can use approach which I described in the answer. You can use resizeStop callback to catch changing of column size and you can call setColWidth method (see the answer for more details) on another grid (on main grid and other opened subgrids).

Related

Angular UI-grid, how to tell what the next column in the scroll is

I have a ui grid that has 20 columns, and I would like to be able to tell what the next column will be as I scroll through the horizontal axis so that I can have some text that will tell the users what the names of all the columns they can't see are.
Anyone know if this is possible? As I watch the the inspector and scroll through the columns, I see html attributes changing.
---UPDATE 1----
This is what is all looks like (where it says "home #" is dynamic and will change to show the next column that is out of site)
Based on the ui-grid configuration that you use to render the grid, you already know the order of the columns. You can use this information together with the visible on each column added by the gird itself.
What you need to do is bind a event handler on scroll to iterate over the columns on each change and check the visibility of them. Then the first one with visible === false is the upcoming.
Here is a working Plunker where is used this flag.

Adding row to jqm grid

I need to know how to add a row to a grid. I declared ui-grid-b with 3 columns. I need 8 buttons in this grid in my footer. How to do this?
You should read about it in jQueryMobile docs. Basically "grids are designed to wrap to multiple rows of items. For example, if you specify a 3-column grid (ui-grid-b) on a container that has nine child blocks, it will wrap to 3 rows of 3 items each." You should also read about toolbars. It may be usefull for a good start.
There is a full explaination:
http://jquerymobile.com/demos/1.1.1/docs/content/content-grids.html

dynamically set smart gwt list grid header

I have created a smartgwt list grid. The grid headers are static and the content is filled with server side data.
The code looks something like this
ListGrid grid = new ListGrid();
grid.setFields();//set columns names..
grid.setData();//pass datasource..
On page load, it first initialize the grid object, set field names (columns) and when the server side data is available, it populates the grid.
This approach is fine when the columns/headers are static. However, I am trying to modifying the grid so that headers are set dynamically. To be more specific, server data will include information about grid header (number of columns of the grid, column names etc). One way to do this, put the header information in a grid content cell and design that cell to look like header.
I want to know if there is any better approach to do this ?
did you see this:
http://www.smartclient.com/smartgwt/showcase/#grid_top_header

styling icons markers - fusion tables

This is offered as assistance to other newbies like myself.
I struggled quite a while to figure out how to assign different icons to different categories of markers in my fusion table project. I found the documentation limited and confusing, and I figure if I was confused then others probably are as well.
With the help of others and lots of testing, I can now share with you two ways to accomplish this.
First note, the icons available for fusions tables is very limited, from a single set that you can see here:
http://www.google.com/fusiontables/DataSource?dsrcid=308519
Magnify the icons floating on the ocean and click on the ones you like to learn their names.
1. Styling from inside the fusion table:
Create a column with a name like "Styles". Be sure to set its TYPE as TEXT.
In the column, add the names of the icons you want to use for your different categories.
Examples of names: star, target and "red_blank".
When you are in map view, click on the CONFIGURE STYLES BUTTON. Under Points/Marker Icon, select Column. Click on "Use icon specified in a column", and from the dropdown, select the column name you have set eg. "Styles".
View the map and you should see your various icons displayed.
2. Styling in your javascript:
Add a styles section to your code. Here's an example (in this case the Styles categories were coded with numbers):
layer_2 = new google.maps.FusionTablesLayer({
suppressInfoWindows:true,
query: {
select: 'Location',
from: 'tableid' //add the id number of your table here, inside the quotes
},
styles: [
{where: "'style' = 14", markerOptions:{ iconName:"star"}}, // other landmarks
{where: "'style' = 13", markerOptions:{ iconName:"wht_pushpin"}}, //businesses
{where: "'style' = 11", markerOptions:{iconName:"red_blank"}}, //town houses
{where: "'style' = 12", markerOptions:{ iconName:"orange_blank"}}, //country homes
{where: "'style' = 15", markerOptions:{ iconName:"target"}},
]});
Both approaches work great. Having worked with both I now think I prefer to do this inside the fusion table, just because I find the simpler I can keep the javascript, the better things work for me.
However, controlling it through the JS makes it easier to change icons on the fly, as you need only change one line of code, instead of changing the icon name in the Style column through every row of your table.
I hope this is helpful.
Wendy
Also worth checking out this help article that describes how to use the Merge function to quickly create the column assigning styles / icons to rows in your table:
Using Merge to apply map styles by category
For custom markers use this instead of FusionTablesLayer,
http://code.google.com/p/gmaps-samples/source/browse/trunk/fusiontables/custom_markers.html?spec=svn2515&r=2515, I think they can be use with makerclusters.
Also note that, for reasons unclear, you can get different results in the classic and current fusion table interface. My fusiontablelayer wasn't showing the right styles on my map even though all appeared well on the fusion table visualization, but when I switched to classic and reset the icon column and fixed the infowindow styling, everything fell into place. Odd, but it worked.

How to sort a QuantumGrid on data from a different column

Is there a way to sort Devexpress QuantumGrid rows on data from a different column other than the one whose header has been clicked? For example, when the header of column A is clicked the rows of the grid are sorted on the data from column B. Visually it should still appear that it is column A that has been sorted as the sort glyphys will be shown in column A's header.
#norgepaul you must check the DevExpress Support Center for the questions related to the DevExress products, This site has thousands of answers and articles related to its products.
check theses links
Sorting by other field (when clicking header) in ExpressGrid 6
http://www.devexpress.com/Support/Center/SearchResults.aspx?searchtext=sort&p=T1|P0|83
I don't have DevExpress here to check, but i would look to see if there is a custom sort event. like OnCustomSort, where you get to decide whether a value or cell sorts higher or lower. I think you'll have the ability to know what rows are being compared, so you could look across to B cells, and make your own comparision.

Resources