logo
down
shadow

ui-grid (ng-grid) calculated width is too wide


ui-grid (ng-grid) calculated width is too wide

By : user4577388
Date : November 22 2020, 09:00 AM
wish of those help I have a dashboard with a sidebar. I am trying to use ui-grid in the main part (called dynamic-content) Here is my html: , You may need a css class to set the width of the grid:
code :
.grid {
  width: 500px;
  height: 400px;
}


Share : facebook icon twitter icon
extjs - set grid column's width wide enough to display text in it

extjs - set grid column's width wide enough to display text in it


By : Clemenza Zhang
Date : March 29 2020, 07:55 AM
wish helps you bensiu, I implemented the login. However, I cannot say that this is the ideal solution but it solves my purpose.
First, i navigate through data and find the longest string in that column (including header name of that column).
code :
// Store the longest string for each column in columns[col].maxstring 

// Define a hidden label
{
    xtype: 'label',
    id: 'lblTab',
    hidden: true
}

var lblTab = Ext.getCmp('lblTab');
var hiddenField = Ext.util.TextMetrics.createInstance(Ext.getCmp('lblTab').el);
var widthValue = 0;

// Iterate through each columns to set its maximum width
for(var col in columns) {
    // find width of string
    widthValue = hiddenField.getWidth(columns[col].maxstring);

    // set column width
    colModel.setColumnWidth(columns[col].index, widthValue + 20, false);  
}
Extjs Grid Width Calculated Wrong

Extjs Grid Width Calculated Wrong


By : ala0a
Date : March 29 2020, 07:55 AM
it should still fix some issue I solved this problem by registering a numbers of listeners on viewConfig.viewready, grid.columnresize and etc. So we calculate the total width of columns each time we render a grid or resize/change a visibility of a column. consequently, I expand the grid to the calculated size. something like:
code :
             var grid = Ext.create('Ext.grid.Panel', {
                 store: store,
                 stateful: true,
                 autoHeight: true,
                 columns: colsData,
                 title: 'Array Grid',
                 renderTo: 'grid-example',
                 viewConfig: {
                     listeners: {
                         viewready:function(){
                             var totalWidth = 0;
                             Ext.each(grid.columns, function(column, index) {
                                    if (column.isHidden() == false)
                                       totalWidth += column.width;
                                });

                             //console.log("Width: " + totalWidth);
                             grid.setWidth(totalWidth);
                         } 
                     }
                 }
                 ,listeners: {
                     columnresize: function(){
                         grid.viewConfig.listeners.viewready();
                     },
                     columnhide: function(){
                         grid.viewConfig.listeners.viewready();
                     },
                     columnshow: function(){
                         grid.viewConfig.listeners.viewready();
                     }
                 }
             });
         });
How can I set up a bootstrap grid of 12 columns with a width of 960px but have rows being 1280 wide?

How can I set up a bootstrap grid of 12 columns with a width of 960px but have rows being 1280 wide?


By : Andres Ramos
Date : March 29 2020, 07:55 AM
I wish this help you If you are using the bootstrap framework then you would use the
outside of a

The container is the element that has the width in CSS whereas the row doesn't have a width so that would span the width of the page that you have while the content would be contained in the container.
code :
@media (min-width: 768px) {
  .container {
    width: 750px;
  }
}
@media (min-width: 992px) {
  .container {
    width: 970px;
  }
}
@media (min-width: 1200px) {
  .container {
    width: 1170px;
  }
}
How do I stop css grid width extending beyond screen width, and how do browsers calculate css-grid width?

How do I stop css grid width extending beyond screen width, and how do browsers calculate css-grid width?


By : olsonkr
Date : March 29 2020, 07:55 AM
Does that help So, what's happening is that you are giving your grid 100vw, meaning, it will be 100% of the width of the viewport right? Well, by default, the body has margin around, so, your grid will be 100vw but because you have margin in the body, the grid seems to go off screen.
So, what you need to do, to reset the layout is:
code :
*{
  margin:0;
  padding: 0;
}
When ng-grid change visibility from invisible to visible by ng-hide, grid width not being re-calculated

When ng-grid change visibility from invisible to visible by ng-hide, grid width not being re-calculated


By : Elmer Meza
Date : March 29 2020, 07:55 AM
it should still fix some issue I had the same issue. Maybe it is related to this issue. I created a new directive as a workaround:
Related Posts Related Posts :
  • gulp-minify without rename original files
  • create a link to run javascript in another window
  • Javascript, Uncaught TypeError: Cannot read property "cells" of undefined
  • Express.js and Sequelize: does not define models
  • Serialize table data as IEnumerable within asp.net WebApi
  • Handle WebPack CSS imports when testing with Mocha and Babel
  • Converting JSON string to Angular function?
  • Bootstrap-multiselect is very slow with a large pool of options
  • Writing back to HTML after reading form input doesn't work (Javascript)?
  • Kendo UI Grid: Get the data of Current Grouping state?
  • A function to test if all svg objects are visible
  • how to change src without reloading the page
  • side menu with drop down menu
  • How to store timestamp a JSON object?
  • HTML5 Form Submit
  • Caret Sensurround by circle CSS
  • Chrome local storage deleting after NWJS application closes on Windows
  • cordova inappbrowser referencing elements
  • Passing multiple variables to another page
  • $.when with arbitrary number of deferred objects?
  • Printing different part of page depending on clicked element
  • Read in cookie to Shiny application with embedded javascript
  • Asynchronous array problems
  • Disable button if certain number of checkbox are checked
  • Write a loop that finds a value and returns a color
  • How to make the page layout stay the same after minimized?
  • Looping div elements using jquery
  • Node.js 'request' module wrapper with optional params - how to write this more concise?
  • Javascript , Object property is shown as undefined
  • How to trigger and wait for the result of a notification from a call back function of an event listener
  • How to populate a form box with javascript based on other form box inputs
  • Default/Overridable content for Aurelia template (template parts)
  • Ember, how to reuse same "partial" for "index" and for "show"
  • Display content from database on HTML page via Ajax and PHP
  • exporting logic as a function in express.js
  • Verifying Docusign Connect Signature with X509 Certificate
  • React js get the value from div
  • What does the notation () => mean and how to use it?
  • JQuery Hide/Show one, not all
  • Split string on backslash or forward slash
  • PHP Inside JavaScript - Quotes Issue?
  • ReactJS Unexpected Token ) on Safari only
  • Use lodash to group array into tree "children" structure
  • With D3, how can I avoid SVG graph links being rendered over nodes?
  • Consolidate nested, overlapping <strong> and <em> tags
  • How to Access an array of objects properties?
  • Simple Push Menu in CSS3 and jQuery
  • addEventListener not working for onDragStart
  • Partial string matching in javascript
  • Posting a title along with a Photo using the FB.api
  • Why is my jquery code not working or throwing any errors?
  • Javascript/jquery - Wrap text with tag at specific position
  • Javascript Canvas can't draw multiple curves
  • Javascript move entire span with arrow keys
  • How to stop my character from going outside the div?
  • How to call in plugin options in jquery plugins
  • Remove default submit on modal form button
  • Generate angular model properties by view, when view fields are empty
  • AngularJS - project files layout, injection and scope clarification
  • get text fields that are not empty
  • shadow
    Privacy Policy - Terms - Contact Us © animezone.co