Add an icon instead of a text in a column - jqgrid

in JQGrid 3.8, is it possible to have an icon instead of text in a column ?
I don't think it's possible but if you have a trick, i'd be happy

There are many ways to add icons in the grid. First way is: the data which be placed in the column header (colNames) or inside of the cell data could be HTML data. So you can easy insert the <img> element in the grid. One more method is th use custom formatters. See here some demos. If the standard jQuery UI icons contain all the icons which you need I would recommend you to use there.

Related

Make Handsontable autocomplete popup wider than the column

The Customer ID column is setup to use autocomplete. The autocomplete values concatenates various customer information together, to aid the user in selecting the correct one. Once selected, the Customer ID is put into the grid.
I cannot figure out how to make the autocomplete popup wider so that it fits the concatenated information.
This is what it needs to look like, which I achieved by tinkering with the elements after they were rendered. Ideally, it would be just wide enough to fit the content.
Try using select2-editor from
https://github.com/trebuchetty/Handsontable-select2-editor
The select2 editor automatically expands to the width of the column text.

Kendo grid expanding column

I'm using kendo grid (which is awesome!) and one of my columns contains a description field. Does kendo come with support for expanding columns? i.e. if over a certain length display a '+' expand icon or will I need to use a third party library?
Thanks
If you want to expand a record, you might use detailTemplate and maybe also detailInit event. Remember that detailTemplate might be either a string (KendoUI template) or a function. This demo shows how to use it.
If you want to expand a column, you should use a template in the column (see it here) definition and program there the logic needed.
Grids do come with a resizing property. Not sure if this fits your needs though.
http://demos.kendoui.com/web/grid/column-resizing.html

Data binding controls in asp.net

I have to display a set of data in the following manner:
Which ASP.NET 3.5 control best matches my requirement?
If one matches, could you please give me an idea about how to format it to view like the image?
Well, first off you have multiple blocks (multiple rows) so I would suggest a Repeater. Within each block you must display three columns (the image the text and the small images), and you should use a Panel (renders as a ). In the second panel you have multiple lines of text for which you can use Labels because they allow for rendering as a so that you an include a class.
Style everything nicely with CSS and you should be able to remake the above picture.
I think repeater control would be fine for your requirement.

jqgrid save xml string inside hidden cell problem

I have 2 grids. in both of them i use loadonce:true .
In the first grid i have a cell with an onblur event which
opens a dialog with the second grid.
after i edit the second grid i want to save as xml it's content and
ascribe it to the row of the first grid (the row witch opened the dialog).
In the end i want to generate an xml from the first grid that will
include the xml I generated before in the second grid.
so what is the best way to implement this?
Thank's In Advance.
Depend on how exactly you implement the scenario which you describe you could has any data in the internal data parameter of jqGrid existing always if one use local datatype or loadonce:true in your case.
Direct accessing to the data parameter per jQuery("#grid_id").getGridParam('data') get your reference to the data array. The data array contain all data of the grid (not only the current displayed page) and the data are not yet placed in the <td> element. So the data are unmodified and could contain for example any XML fragments.
UPDATED: To make you easier to understand what I mean I made the small demo. If you double-click on a row you will see the XML data associated with the row.
The "note" column can be hidden. Because all hidden columns exist in grid as HTML markup I made it visible. You can see the difference what can be saved as grid internal data and what can be displayed (also as hidden data).
UPDATED 2: You can consider to use autoencode:true option in your grids.

DataGrid column header with a text box for filtering

I'm having a bit of problems creating a DataGrid with a header label AND a text box (at this point I'm not even entirely sure this is possible).
Here's what I want to do:
I need to dynamically create a table (the number of columns can and will change, so the grid needs to be created dynamically and cannot use bindings specified in the XAML code or similar). All the columns however will always be text columns.
Because those will be text columns, I'd like to add a text box to each header to enable simple filtering of the data in the DataGrid. I don't want to add extra text fields to OTHER parts of the Silverlight page, as I want to keep things as compact as possible. Also, since the number of columns is dynamic, adding a large number of text boxes above the DataGrid wouldn't look too good either. ;)
Also, if possible, I'd like to keep a label in each header to display the names of the columns as well.
So far I've tried adding the a TextBox as the Header of a DataGridTextBoxColumn but when I do that in a very simple Silverlight project, the whole DataGrid won't show up.
Please help.
EDIT:
I saw the answer to this question: placing a text box inside the silverlight data grid column header
However, the answer itself didn't give me much to go on (the example is too short, and I'm not too good with XAML yet), and the code on CodePlex just adds extra fields to the Silverlight page. None of it tackles the problem of dynamically creating the DataGrid.
OK, here's what I did that solved my issue...
I had to use a Style to achieve the functionality of having an extra text box inside each column header and filling out the Tag property of each thus created TextBox to later find out which column has been changed.

Resources