slickgrid

resizing a slickgrid column header causes it to be misaligned with body

丶灬走出姿态 提交于 2019-12-06 12:26:40
问题 I am using SlickGrid 2.2 with Bootstrap 3.1.0 css. When I try to resize the column header, the column header cell is not aligned with the cell in the body. The header is consistently larger than the body whether I am shrinking or stretching it. I am using the code from example 1: html <div id="myGrid" style="width:600px;height:500px;"> javascript var grid; var columns = [{ id: "title", name: "Title", field: "title" }]; var options = { enableCellNavigation: true, enableColumnReorder: false };

Slickgrid save all data at once

好久不见. 提交于 2019-12-06 11:01:08
I am trying to save all the data in a slickgrid at once rather than one at a time, my plan was to use Saving changes in SlickGrid so my code is : <script language='javascript' type="text/javascript"> function saveQuote() { $("input[name='mydata']").val(jQuery.parseJSON(grid.getData())); } </script> with my data being a textbox ... (so I can debug and see what is happening) My Grid is empty to begin with and the user adding data(which has calculations etc) however when I press my save button and call my saveQuote no data is being presented, any one know why? the problem was with: $("input[name=

Use slickgrid inside a bootstrap modal

我与影子孤独终老i 提交于 2019-12-06 05:33:01
Is it possible to user slickgrid inside a bootstrap modal? I tried and the slick-viewport div height is set to 2px instead of the right size. I'm also using expand and collapse buttons, but when I expand, only the current number of rows is shown, adding a scroll but with extra empty lines instead of the child lines of the expanded node. Can anyone help? Thanks Try manually init-ing the grid after the modal finishes loading. You can do this using explicitInitialization: true as explained in http://mleibman.github.com/SlickGrid/examples/example-explicit-initialization.html P.S. - adding this as

Make one column fill remaining space in SlickGrid without messing up explicit width columns

允我心安 提交于 2019-12-06 05:07:47
Some of my columns need explicit widths, while others should just fill up all available space. There is a forceFitColumns option, but it seems to ignore any explicit widths I've set. I want my explicit widths to be respected, and for implicit ones to be estimated sanely. I guess to get this behavior I'd have to disable the default column width and rewrite autoSizeColumns to not mess up my explicit column widths. I can imagine a convention where you put in '*' for the column width if you'd like it to be auto-sized instead of using the default. Has anyone made a fork that has this kind of

How to put HTML into Slickgrid cell?

落花浮王杯 提交于 2019-12-06 03:52:30
问题 When I put <a href="#">Click</a> into slickgrid, I see the actual code " <a href="#">Click</a> ", whereas I expect the link to be rendered. I know I can do it by subscribing click event but is it restricted thing in SlickGrid? 回答1: Write a custom formatter: function myFormatter(row, cell, value, columnDef, dataContext) { return "<a href='#'>Click</a>"; } and specify it in the column definition. 回答2: From @RicardoStuven Or use the defaultFormatter option to treat any value as HTML:

How do I create merged cells in SlickGrid?

依然范特西╮ 提交于 2019-12-06 03:34:10
Is it possible to create merged cells in SlickGrid? If not, then what other javascript grid solutions allow merged cells. If you mean cells spanning across multiple columns, this is supported via "colspan" as demonstrated in this example - http://mleibman.github.com/SlickGrid/examples/example-colspan.html . Spanning cells vertically across multiple rows is not supported. I have got some codes when using formatter to merge cells in the differnect rows. Tin, please can you check this solution, maybe it's not the best one, but it works fine. thanks. 1) reference VerCellMerged formatter { id:

resizing of grid when resizing browser window

穿精又带淫゛_ 提交于 2019-12-06 00:10:51
问题 I used a fill whole window example as a default. Tried to resize browser window: but area, that is used for grid is the same. Need to reload page so that it fits. How can I archive this without reloading page ? Edited Interesting fact that when I change order of columns grid is resized. 回答1: This works fine for me. Maybe the resizeCanvas() function is a new feature in slick grid. The code is CoffeeScript. $(window).resize -> grid.resizeCanvas() 回答2: This works better than just changing .slick

Do action after render() method is completed

无人久伴 提交于 2019-12-05 21:38:11
问题 I need to do some action when render() method finished its work and appended all HTML elements to DOM. How to subscribe to onRenderEnds event (there is no such event)? Can I write my own event outside of slickgrid code and attach it to render() method? There are some events "onScroll", "onViewportChanged" but they happened before render() finished (in some cases). Update: I write formatter for column: formatter: function(row, cell, value, columnDef, dataContext){ return "<div class=

Missing space when I change the cell's background color in SlickGrid?

北城以北 提交于 2019-12-05 13:53:03
I was trying to change cell's background color with custom formatter like this: var myCellFormatter = function(row, cell, value, columnDef, dataContext) { if ((row + cell) % 5 == 1) { return "<div style='background-color:green'>" + value + "</div>"; } else { return value; } }; but this does not color the whole cell. There is some space between cell's div and the div in the formatter. How could I color the whole cell ? Add a CSS class to that column ( columnDefinition.cssClass="myCell" ) that would set the padding of the cell to 0px. 来源: https://stackoverflow.com/questions/2746417/missing-space

Can I add a column to slickgrid on on the fly?

时光怂恿深爱的人放手 提交于 2019-12-05 13:18:01
问题 Is it possible to add an entierly new column to a slickgrid on the fly. I am trying to make a user buildable matrix and need them to be able to add columns as they build. 回答1: var columns = grid.getColumns(); columns.push( columnDefinition ); grid.setColumns(columns); With for instance var columnDefinition = {id: "column1", name: "title", field: "column1", editor: Slick.Editors.Text}; 来源: https://stackoverflow.com/questions/4463176/can-i-add-a-column-to-slickgrid-on-on-the-fly