Comments on: 6 Ways to Take Control of Displayed Data in UI Grid https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/ Wed, 29 Apr 2020 09:02:00 +0000 hourly 1 By: Brian Hann https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-366 Wed, 17 Apr 2019 17:56:00 +0000 http://104.131.219.158/?p=71#comment-366 Yea I don’t think that’s possible in ui-grid.

]]>
By: Nani A https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-365 Tue, 16 Apr 2019 06:56:00 +0000 http://104.131.219.158/?p=71#comment-365 https://uploads.disquscdn.com/images/dac63831afb437a275177d187442c93b54a435d3bded46eb5f21c69740b69104.png Hi, i want the grid columns display as vertical way. now we are adding rows in horizontal way right in the same way i want adding rows in vertical way.

is any suggestions for this.

Please find the screenshot for vertical grid.

Thanks.

]]>
By: Brian Hann https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-364 Mon, 15 Apr 2019 14:48:00 +0000 http://104.131.219.158/?p=71#comment-364 I’m not sure what you mean by “vertical”. Do you mean orienting column so they go bottom to top instead of left-to-right?

If it’s simply reorienting the grid you could maybe try using CSS: transform: rotate(90deg) and see what happens. Otherwise you’ll need to maybe post a screenshot of what you want so I know what you mean.

]]>
By: Nani A https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-363 Mon, 15 Apr 2019 14:14:00 +0000 http://104.131.219.158/?p=71#comment-363 Hi Brian,
I have a requirement to display the grid as a vertical way. Is it possible with the current Ui-grid.
Can you please give one example on this.

]]>
By: chetna gupta https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-354 Tue, 06 Mar 2018 07:55:00 +0000 http://104.131.219.158/?p=71#comment-354 I have a ui-grid datatable which gets refreshed on every 30second interval. Basically i make a http call to get new data every 30sec so while my new data is still been transmitted we see that the grid gets empty for few seconds until it loads the new data.Is there a way in ui-grid where i can keep the old data persistant until the new data is pushed in so that the user doesnt see any white patch which is caused due to latency in fetching data.Thanks!!

]]>
By: deepak https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-349 Fri, 03 Nov 2017 06:20:00 +0000 http://104.131.219.158/?p=71#comment-349 Hi! i have a problem in angular UI grid i want to know how to add custom function to calculate total rows rendered is it possible.

]]>
By: Claudio Viola https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-348 Tue, 17 Oct 2017 16:14:00 +0000 http://104.131.219.158/?p=71#comment-348 Hello @brianhann:disqus
Thanks a lot for this complete guide!
I focus on a sorting feature, indeed, in my case I’ve to enable only 1 sorting at a time. I try to explain it: when I click on column’s header to enable sorting on it I’ve disable/reset the sorting on the other one.
Also I wouldn’t to disable completely all sorting, at least 1 sort must to be enable.
How can I achieve it?
Thanks again!
Claudio

]]>
By: Prashasti Shrivastava https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-345 Tue, 26 Sep 2017 12:27:00 +0000 http://104.131.219.158/?p=71#comment-345 Hi, I am using custom editableCellTemplate: ‘{{timeValue | date: “H:mm”}}’
Goal: On single click or tap(mobile application), above template should appear.
Problem: template only appears after double tap on a cell, eventhough I am using editCellOnFocus:true. Any suggestions on how can I display the template on single tap?

]]>
By: Aalokit S. Chhabra https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-335 Wed, 12 Jul 2017 11:55:00 +0000 http://104.131.219.158/?p=71#comment-335 Hi Brian.. It was great help.
Need some help. i need to add columns dynamically without giving there static definition’s. It has to be added as per the number of columns fields that i receive in my json. could u please guide.

]]>
By: Adam P https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-326 Wed, 10 May 2017 14:47:00 +0000 http://104.131.219.158/?p=71#comment-326 @brianhann:disqus
Thanks this post is helpful. I have one question though: do you have a recommendation for a scenario where I can use a shared template across various grids in my app, but each one has a few different parameters I need to pass to the template. Example:

https://uploads.disquscdn.com/images/4db2f80f634035e38ae31ed7d74a73cf24a3afee35c5d3ae442e4b91bcaf7288.png

There are 3 buttons there, View (most prominent), Edit, and Delete. The VIEW and EDIT buttons need to take the user to a different state (using UI Router). Also, my ID fields vary in name (SiteID, SiteGroupID, etc). Is there a specific path you would recommend?

Currently I’m using a cell template with the UI defined (as seen in my screenshot). Ideally, there would be a way for me to pass in the viewSref and editSref as parameters into the colDefs item – but I’m not seeing an easy “proper” way to do this.

I did hack this to work (but I hate the way I’m doing it!!!!) by doing this:

columnDefs: [
{
name: ‘ ‘,
width: ‘130’, minWidth: ‘130’,
cellTemplate: ‘views/actionbuttoncell.tpl.html’,
viewSref: ‘siteevent.detail.view({ siteEventStagingId: row.entity.siteEventStagingId, siteGroupStagingId: grid.appScope.siteGroupStagingId, siteStagingId: grid.appScope.siteStagingId })’,
editSref: ‘siteevent.detail.edit({ siteEventStagingId: row.entity.siteEventStagingId, siteGroupStagingId: grid.appScope.siteGroupStagingId, siteStagingId: grid.appScope.siteStagingId })’,
deleteFunc: function (record) {
// RESTful delete, then refrsh … $http…
},
},

My template looks like this:

View

It works, but it’s really nasty. I’m just forcing these new properties that don’t exist. I’m switching to TypeScript and this is becoming a really problem especially now because these properties obviously don’t exist in the defined Type.

I feel like there must be a better way.

Thank you

]]>
By: Kishore Sakthi https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-296 Sat, 26 Nov 2016 05:34:00 +0000 http://104.131.219.158/?p=71#comment-296 is there any way to show a popup modal on clicking button inside a cell?

]]>
By: Martin Sher https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-291 Sun, 20 Nov 2016 17:12:00 +0000 http://104.131.219.158/?p=71#comment-291 Hi

Thanks for the example,

In the example of adding a button how can I only have the button non-disabled for a row if the row is selected.
I have tried using ng-disabled=”row.entity.id == selectedItem.id”

where selectedItem is set to the selected row,

This correctly disabled the button when the grid is loaded but does not enable the button when the row gets selected.

Any ideas.
Martin

]]>
By: Den https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-288 Thu, 17 Nov 2016 10:44:00 +0000 http://104.131.219.158/?p=71#comment-288 I’m using the example in Bindings in Cell Templates which works fine except that it causes 2 invalid get requests when the grid first appears:
GET https://127.0.0.1:8443/%7B%7B%20grid.getCellValue(row,%20col)%20%7D%7D 404 (Not Found)
GET https://127.0.0.1:8443/%7B%7B%20COL_FIELD%20%7D%7D 404 (Not Found)

which causes havoc with our error reporting.
Any idea what’s causing this and potential fix would be welcome.

]]>
By: Argha Sen https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-287 Thu, 17 Nov 2016 05:14:00 +0000 http://104.131.219.158/?p=71#comment-287 The sparkine chart is inverted. How do we fix that??

]]>
By: German Simba https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-285 Thu, 10 Nov 2016 20:07:00 +0000 http://104.131.219.158/?p=71#comment-285 Please do not understand ui-grid and the params , your help, I need to build the templates dynamically depending on the value data, sombody

]]>
By: Vishwam https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-281 Mon, 07 Nov 2016 08:18:00 +0000 http://104.131.219.158/?p=71#comment-281 Awesome post. Thanks a lot

]]>
By: hari7priya https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-271 Thu, 06 Oct 2016 21:54:00 +0000 http://104.131.219.158/?p=71#comment-271 Trying to get width of the grid dynamically using ng-style depending on number of columns:

controller:

$scope.gridwidth = function (columns) {

var gw = 0;
for (var i = 0; i < columns.length; i++) {

gw += columns[i].drawnWidth;
}
var width = gw.toString() + "px";
console.log(width);

var gridstyle = {
"max-width": width,
"min-width": width,
"width":width
}
return gridstyle;
}

Console gives "NaNpx"… please help me out!

]]>
By: Camie DeCovich https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-257 Sat, 13 Aug 2016 00:54:00 +0000 http://104.131.219.158/?p=71#comment-257 Hi Brian – Wondering if you could provide some guidance. I am trying to create a filter to display a date. The JSON date looks like: “CREATEDATE”: “/Date(2016-06-29T18:07:40.000+00:00)/”,
I would like to create a filter function to remove “/Date(” and “T18:07:40.000+00:00)/”, and format the remaining to MM-DD-YYYY. Any examples you could point me to? Thanks!

]]>
By: Soofi https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-248 Wed, 29 Jun 2016 10:24:00 +0000 http://104.131.219.158/?p=71#comment-248 Hi, Can you give me some ideas regarding the issue, I’m trying to add an ui-grid to modal dialog. Works fine. Need to add the rows dynamically. Thats too ok but in my rows we have specific type of input like if there are three columns name, age and experience. In that name will be a Text, age will be a dropdown and experience will be dialog with ui-grid again. So while adding a row I’m unable to find the type. I’m using cellTemplate in columnDef. While adding a row inserting empty object in column.data.push({}). Any help will be appreciated.

]]>
By: Julio Vazquez https://brianhann.com/6-ways-to-take-control-of-how-your-ui-grid-data-is-displayed/#comment-227 Fri, 25 Mar 2016 17:07:00 +0000 http://104.131.219.158/?p=71#comment-227 I’m working with an ng-grid and some columns have filters applied. However, when I export to CSV the values are displayed without filters: a record might like json object

]]>