Wrapping text in grid column - atk4

I want the text in a column of a grid to wrap. The grid is created with a model. I have found the format_wrap-method, but it does not seem to do anything:
$grid->format_wrap('description');
What do I do wrong?
Thanks,
Jeppe

Don't use such a methods directly.
This is only correct way to use formatters:
$grid->addFormatter('description','wrap');
https://github.com/atk4/atk4/blob/master/lib/Grid/Basic.php#L237

Related

How to adjust multiSortLimit in grid

I have a grid with the multiColumnSort property to be able to order the data depending on the columns which were clicked. The problem is that I can only have 3 columns selected. In the ExtJS docs is a hint which indicates to use the 'Ext.util.Collection' to adjust the multiSortLimit property. However, I do not know how to use the 'Ext.util.Collection' for the grid.
The Link to the docs: https://docs.sencha.com/extjs/6.5.3/classic/Ext.util.Collection.html#cfg-multiSortLimit
You need to reference to Ext.util.Collection in Store.
You can do it by : store.getData() and next use setMultiSortLimit on it to change multiSortLimit.
store.getData().setMultiSortLimit(5);

Grid cells with bullet points

I am trying to implement a ExtJS based grid where users would change column data or enter empty columns. Is there a way to show/enter contents as bullet points on ExtJS grid cell like we usually do in Excel?
Thanks in advance
Check this fiddle - https://fiddle.sencha.com/#fiddle/mpl
The Idea is to use htmleditor as the column editor in your grid. However, there'll be quite a lot of work involved in positioning and styling when the html editor opens up for editing.
The fiddle that I created contains just the editor with no styling so it doesn't open good. And when you try, try editing the first column in third row data.

How to hide the entire Ext.selection.CheckboxModel in ExtJS grid

I need to hide the entire column of the check box (Ext.selection.CheckboxModel). I found out to get the columns of the grid to hide, but the columns does not give the checkbox column.
grid.headerCt.items.getAt(0).hide()
This worked for me in 4.2.2. I used a combination of the other answer by Saki and a little traversing through the DOM because the "getAt0).hide()" solution did not work for me either:
grid.headerCt.items.items[0].hidden = true;

Different elements in grid column

Is it possible to have different elements in a Ext JS grid column? If yes, how can I do this? If no, is there another appropriate solution? Maybe with an example.
Thanks for your help!
Kind regards, shub
What do you mean by different elements exactly?
You could use a TemplateColumn, and put in any markup and record values that you want
You could use the .renderer() method to return any markup that you want
You could use the .getRowClass() method to return a different css class depending on content
If you want to put an actual ExtJS component in a grid column, you should use Skirtle's ComponentColumn

ExtJS Combobox with Checkbox

I want to design combo with checkboxes(display checkboxes along with dispalyfield)
i tried lovcomb, but not getting
is there any alternative for this or how to use lovcombo for multiple section
Thanks in advance
Alternative method (with out checkboxes):
http://technomedia.co.uk/SuperBoxSelect/examples3.html

Resources