Tabulator context menu won't show - javascript

I have a problem with Tabulator.js library. I am usig version 4.8, I would like to use context menu feature, but I am unable to make it work. When I use code from documentation (see bellow) browser default context menu is replaced by nothing (nothing shows up). I was not able to find answer to this. Is here someone with similar experience? I have tried three different browsers,but behavior appears to be same in every one of them.
rowContextMenu: [
{
label:"Hide Column",
action:function(e, column){
column.hide();
}
},
{
separator:true,
},
{
disabled:true,
label:"Move Column",
action:function(e, column){
column.move("col");
}
}
]

Unfortunately the example is in error. The rowContextMenu action function does not provide a Column component. It provides a Row component.
If you want to manipulate a column you will need to setup Column Menus. Start by looking here and scroll down to see the other options - http://tabulator.info/docs/4.8/menu#header-menu.
For Rows look at Row Context Menus - http://tabulator.info/docs/4.8/menu#row-context

Unfourtunately, it was all my mistake, I surely did update tabulator js version but forgot to change CSS file, so menu was working right but was shown as div without styling on the bottom.

Related

How to add a drag and drop property to mui table that has also expanded rows(like tree). How to do drag and drop only inside the same level items?

I want to create a draggable mui table with the help of the react-beautiful-dnd. But there is no examples with datas that are like tree. Only one level examples are there over the internet. Can you explain or give a sandbox code example?
I tried to do that with the help of TableBody(MUI), TableRow(MUI), TableCell(MUI), DragDropContext(beautiful-dnd) , Droppable(beautiful-dnd) , Draggable(beautiful-dnd). onDragEnd={(result) => {
handleEndDrag && result.destination && handleEndDrag(result.destination?.droppableId, result.draggableId); The result values doesnt come truely. Always the result.destination?.droppableId comes one after or one behind.

How to restore the columns to same place on jqGrid ColumnChooser?

I am using jqgrid .
My aim is to view hide columns .I used columnChoser like mentioned below .
$('#Table').jqGrid('columnChooser', {
done: function (perm) {
if (perm) {
this.jqGrid('remapColumns', perm, true);
}
}
});
Problem : The trouble here is the colums are adding to end of table while restoring. Is there any way to restrore them to same place .
Can someone explain me what is perm ? Is there a way to show only specific colums in the columChoser based on column index like ex: [ 3,4,7]
Any help would be appreciated.
If I understand correct the problem, I'm not sure that the problem can be solved with the current implementation of ColumnChooser. When you try to add visible column (from right to left list), the ColumnChooser add it to the end of list without to care of the original position. I will need to see if this will possible. I will replay to this post. In order to get better support if you use Gurrido jqGrid, I recommend you to write your questions in our public forum here

disable kendo-ui grid multi column filtering

How to disable kendo-ui grid multi column filtering?
I need to clear other column filter value when filtering with a column, and filtering only possible with single column(Not combination filter)?
demo: https://so.lucafilosofi.com/disable-kendo-ui-grid-multi-column-filtering
try this:
var datasource = $("#grid").kendoGrid({
columns: [{}],
filterable : true,
filterMenuInit: function(e) {
$("form.k-filter-menu button[type='reset']").trigger("click");
},
dataSource: {
data: [{}]
}
});
NOTE: after some research i noticed that this is a common issue in the kendo community as well as is one of the most wanted feature to bind the filter menu event, but still there is no valid fix. so, i decided to hack the source code a little bit (just few lines of code), this task has been quite annoying since the kendo source is only available in compressed/obfuscated format for non licensed copy, BTW, you can see the result on the demo page and look into the source code. source on github for direct cdn file inclusion hope this help someone...

Extjs 4.02 - Custom component needed

I am trying to create a custom container but can't figure just how to do it.
I need it to look like this:
(don't pay attention that it is RTL, this is only a sketch to get started)
where the orange fonts are the title of the page that I would like to be an H1 element.
It has a simple search and an advance search that pops open when the little arrow next to the search button is clicked.
Questions:
1) What should I extend for that ?
2) How can I implement different advance search forms for different pages ?
3) how can I place a setter for the title that controllers can interact with and manipulate the dom ?
basically any advice will be good as I need a start point.
thanks
There are lots of ways of doing this, but this is what I would do.
I'm not sure about the "advanced forms for different pages" can you go into mre detail about that? Are you looking to autogenerate a search form somehow?
Extend Ext.form.Panel, and use a table layout for the fields
See: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.layout.container.Table
use a "tbar" on the panel instead of setting "title". you can place the search combo, tbfill, then a tbtext for the "title". As a convenience you can override the setTitle function of the panel to manipulate this tbtext field instead of the normal behavior. Something like this:
Ext.define('MyApp.view.MyForm', {
extend: 'Ext.form.Panel',
alias:'widget.myform',
layout:{
type: 'table',
columns: 4,
tableAttrs: {
style: {
width: '100%'
}
}
},
//overridden setTitle
setTitle:function(title){
Ext.getCmp(this.id + "_search_combo").setText(title)
},
defaults:{
xtype:"combo",
//rest of combo config here
},
items:[{
//...
}],
initComponent:function(config){
this.tbar = tbar:[{
xtype:"combo",
//...
id:this.id + "_search_combo"
},{
xtype:"tbfill"
},{
xtype:"tbText",
cls:"my_form_title",
value:this.title||""
}]
//prevent default title behavior
delete this.title
this.callParent(arguments);
}
})
I would suggest you to just extend from Ext.panel.Panel itself, and hijack the dom for all those customized items, add in search bar, etc. If you do not want any of the fancy stuff from Ext.panel.Panel, you can also extend it from Ext.Component, or Ext.container.Container (to contains more components), and even the lowest Ext.util.Observable.
It seems like you might need to extend a few Ext.menu.Menu and defines some different set of input boxes, so that you could benefit from creating a floated menu (if that's what you want). Or if you have time, you can even just extend from Ext.Component and build your own customized component, or even lower, Ext.util.Observable.
The setter? It will be in the extended component in (1) then :)
All of these serve as rough opinions. They could be different depends on your requirement.

dojo grid: naviagion

I am exploring dojo grid, and could not find a good example of how to handle navigation by clicking on the row.
There is a simple grid example here
How to extend the code with the following requirement
handle doubleclick event on row items
read the identifier and extract the value corresponding to the selected row ( 12 for first row)
redirect to {current domain}/view/{identifier} (like www.example.com/view/12)
any help would be a great time saver...
thanks.
EDIT: added javascript tag so that more user may see this post (only 9 so far with dojo alone)
I had to solve problems 1 and 2 above.
You can use dojo.connect to connect the grid to the onRowClick event. For example, if you have a grid of the form:
<div dojoType="dojox.grid.DataGrid" jsId="grid" id="myGrid" structure="layout" selectionMode="single"></div>
You can then call in JavaScript:
dojo.connect(grid, "onRowClick", clickMethod);
clickMethod can then access the data from the row as follows:
function clickMethod(event) {
...
selected_index = grid.focus.rowIndex;
selected_item = grid.getItem(selectedIndex);
//Not sure if this is the most efficient way but it worked for me
selected_id = grid.store.getValue(selectedItem, "field_name_from_store");
...
}
I imagine you can do a location.href or similar after that.

Categories

Resources