hi i am using jqgrid and want to do something like if i set multiselect:true and also set keyboard navigation. then my grid should work both functionality.
Can any one tell me how to do that.
Thanks
jqGrid have till now very restricted support of the keyboard navigation. The current implementation of bindKeys don't support multiselect:true option.
One possible implementation of bindKeys which supports multiselect:true I posed in the answer. I can warn you that the suggestion solution was only quick & dirty way to have keyboard support in case of multiselect:true. The better would be to use some key like Space key to select the row and use Up and Down to change the focus only without selection of the rows. One could use ui-state-focus and ui-state-hover to mark the row which has the focus instead of selection the row.
Related
I am using SWT tables in my project and there are few columns which are having longer strings which are not completely visible by default (for ex. path to a file location). Though I have tooltip to show the content and using mouse we can increase the column width to see the complete value.
Is there a way to do it with only keyboard usage?
Note: This question is more related to accessibility.
The following answer is based on my experience under windows. It can be different for other OS.
I'm afraid that there's no keyboard-only default way to adjust the size or reorder the column in a table, tree view or list view.
This is true not only with SWT but also with all other frameworks based on native win32 such as wxWidgets.
You must provide a keyboard-only way to resize and reorder columns yourself. here are a few ideas implemented by some applications:
Provide an option somewhere in the application that opens a dialog box with a checkbox list of the different columns. Ctrl+Up/Down to swap two items. Check/uncheck an item with spacebar to make the column visible or invisible.
Make the headers focusable. Use Shift+Left/Right to resize, Ctrl+Left/Right to swap two columns. Application key / Shift+10 opens a context menu where you can check/uncheck columns to show/hide and an option to open the column selection dialog box.
Some screen readers allow to do it by simulating mouse operation in some way. For example, use Jaws cursor, click lock on a header, release lock on the header to swap with.
But it's quite complicated, not always reliable, and thus very rarely actually used.
This is a very good question. I would be happy to give 100 rep to someone giving an answer being for windows and:
generic, working by default, everywhere or in most cases
Independant from screen readers (Jaws, NVDA, etc.) and techniques that simulates the mouse with keyboard (mouse keys)
Unfortunately, I don't think it exists.
I need the ability to navigate the data within the jqGrid. I have virtual paging turned on scroll = 1 and multiselect turned on.
I need the ability to use keyboard arrows keys, page-up, page-down, home, end button.
Page up and Page down to move between pages and home to go to the first page and end to the last page in the jqGrid.
Anyone who has done this or how this can be done would be most appreciated..
It is not quite clear how keyboard navigation should work in case of multiselect: true. You can find some old suggestion (which is far to be perfect) in the answer. I think that good implementation of keyboard navigation should include keyboard navigation which change the focus of the row only and not change the selection. Another key, like space, should be used to select or unselect rows. Additional work should be done to implement selection of the ranges of rows (with the usage of Ctrl and Shift for example).
I am just learning about the impressive SlickGrid library; and here's my question:
We would like to give users the ability to drag & drop columns from a list of possible columns into the grid to add columns (and possibly likewise drag & drop columns out of the grid to remove columns). Think: Outlook field chooser - where you can add/remove the To column, the From column, etc. via drag & drop.
Any chance that this might be possible? Many thanks, Dave
It isn't drag and drop, but there is a context menu in the header that allows you to check off the columns you want to show/hide. You can customize it in the slick.columnpicker.js file.
This isn't currently possible since you'd essentially have to modify SlickGrid's built-in column management code. As part of an on-going componentization of SlickGrid, that code may get moved into a separate plugin, which would make it easier to extend. In the meantime, you can extend the column picker control (included in the distro) to have two lists with columns that can be drag'n'dropped within the control itself (not onto the grid's columns).
I have a datagrid with many columns. This makes it pretty wide. Now we want to add more information to the table. Aside from removing or shortening existing columns what are some ways we might be able to add additional information without adding new columnes.
The data we want to add would be one of several values. For example:
Projected
Actual
Other
For other cases when the value was an off/on or true/false we would change the color of the row. In this case that doesn't seem to be a good option.
Another thing we considered is using an icon to indicate the information.
Any other ways this could be done?
A solution i've seen implemented with grid components is to have a column chooser - some sort of popup dialog that lists the columns and you can select which ones you would like to see in the grid. You should be able to invoke this popup by triggering it from the grid, e.g. it might appear as an option when the user right clicks and causes the context menu to appear.
Can you group related information into tabs?
an overflow area? ie a number of fields underneath the table that populate based on the selected row.
or just only show the minimum needed info and the have full details in a popup when doble clicked or something..
1) Popup on row hover
2) Drop open inline in the grid with extra info on row click
One technique I've used in the past was to create a "container" type of class that has its own labels and textboxes, and you can arrange them however you want, then insert this class into a single grid column. You still have to do some tricks on binding multiple controls that are not native "grid column" controls, but should help you along. Then, you can actually have each row a single container control in a single grid column...
You can't add completely new data to a grid without reserving a column to display it. The best solution I've seen is to provide only the essential information in the grid displaying all records, and then create a drilldown view that shows all of the data for one row. The drilldown can either be a new view in the same form, a popup for an additional window, or perhaps a mouseover popup.
I've worked on systems that use all sorts of shortcuts to display every last bit of information on a single page, and I found that it just made everything more confusing and harder to use. "Oh, that little icon there means that <insert something totally unrelated to the icon picture>."
How do I disable particular columns in MSHFlexgrid in VB6.0? I don't want my user to edit the values in a particular column.
I don't think the MSHFlexGrid control allows users to edit its data in the first place. Therefore, in effect, all columns are disabled. Job done :)
In fact, you have to add custom code to enable updating e.g. add an appropriate control (textbox, combo, date picker, etc) that does allow editing, hide it at design time, then at run time detect which grid cell should have focus, move and size the control to fit the cell then make it visible then handle events to validate the input then write the contents back to the recordset...
...or you could purchase a third party control that does all this out of the box. The MSHFlexGrid that ships with VB6 is essentially a cut-down version of VSFlexGrid Pro, which I've used and thought was quite good. It has a different way of handling hierarchical data by creating groups (rather than bands) which is superior, IMO. The best thing that can be said about the MSHFlexGrid is that it is easy to bind to a hierarchical ADO recordset to simply display the results but not good if you want to do nice formatting or make the grid editable. The VSFlexGrid Pro, if you can afford it, has more power e.g. you can create data source classes to handle binding to custom data structures (ships with VB6 examples of this including ADO recordset binding) which would be invaluable IMO if you intend to make your hierarchical grid editable.
'A Shortcut way is here... NOT in a proper way. But you can try
'if you need to lock the first 3 columns please use this code:
msf2=name of MSFlexGrid
Private Sub msF2_EnterCell()
With msF2
If msF2.Col = 0 Or msF2.Col = 1 Or msF2.Col = 2 Then
msF2.Col = 3
End If
End With
End Sub