Disabling entire slickgrid - slickgrid

How can I disable/enable the entire grid ? (greying out and disabling mouse and keyboard)
I tried wrapping the grid div in a fieldset and then doing:
$(grid.getContainerNode()).parent().prop('disabled', true);
I can see the fieldset gets the disabled property but the grid still respond to mouse/scroll etc
Any help ?

Related

jQuery-UI's selectmenu is not following the scroll motion when it is inside an overflown div

When I am placing the jQuery selectmenu inside a div that has a CSS property overflow: scroll and is smaller then its content, then the dropdown menu is not following the scrolling inside the overflown div.
See the example here
https://codepen.io/Nighel123/pen/gZeQVd?editors=1000
I have found a way to fix it with this code:
$(".demo").scroll(function(){
$( "#salutation" ).selectmenu( "open" );
});
But I think this is not the best way to fix the problem since the dropdown does not seem to follow the select element precisely when I am trying the code on my computer. Additionally the dropdown menu opens when I am scrolling inside the overflown div, what is also not the expected behavior of a dropdown.
I also tried to trigger the scroll event of the window object, when the overflown div gets scrolled to fire the positioning methods of the jQuery dropdown menu. But this did not work at all.
I would like to follow the dropdown menu follow my select item more precisely with the scrolling of the overflown div. And maybe also get some less ugly hack compared to what I did above.
I found a solution with the appendTo method of the jQuery-UI selectmenu. Just append the dropdown menu to the div that is being scrolled and it works!

Kendo UI treelist hide button

I am using Kendo UI TreeList & Grid for jquery. I want to hide a command button based on row values. In grid, I attached dataBound event to evaluate the model value and show/hide command button, below codes works fine
dataBound:function(e){
var delButton = e.container.find(".k-grid-Delete");
if (...) delButton.hide();
}
For TreeList, the same code seems also fine. However, when I add inline edit featrue, the same codes works differently.
When click "Edit" or "Add", the grid stay the original visible status, but treelist show all the button.
When click "Cancel", I triggered dataBound event in cancel event so the UI can be refreshed, then the grid show correctly but treelist still show all the buttons even if the dataBound is executed with correct logic.
Does anybody know how to resolve this issue?
Thanks,
Ziff Dai

onRendered callback

I need to implement a sought of onRendered() event that would ensure all of the grid is rendered before I do something, which is to .hide() it. My gaol is to have a .hide() and .show() button attached to the div the grid resides in, with the default status set at hidden. The problem is that at the point in which my script executes the initial .hide(), the grid is not fully created yet by the grid.js script. I would rather not do any delay loop. Much rather have a callback.
Any help would be appreciated
Thanks
Pat
This should work without a callback. I have a SlickGrid app where I show and hide the grid in response to UI events. The grid exists as soon as it is instantiated (with new Slick.Grid) and can be manipulated with the .hide()and .show() methods.
I did find one catch though...
If you create the div tag with display: none (so it is initially hidden) the grid columns do not initialise properly. To workaround this I create the div tag with visibility: hidden and remove this style before using the .hide()and .show() methods.
My code looks roughly like this:
<div id="mygrid" style="visibility: hidden"></div>
$grid = $("#mygrid")
grid = new Slick.Grid($grid, gridData, gridColumns, gridOptions);
// Hide grid by default, remembering to remove the visibility style
$grid.hide();
$grid.css("visibility", "visible");
// You can now show and hide the grid using normal jQuery methods
$grid.show();
$grid.hide();
Hope this helps.
The slick grid has implemented an event onRendered event github source. We can subscribe to this event and make the appropriate use of it.

UPDATE (Event) PROBLEM WITH AJAX ACCORDION CONTROL

I Have three records which I want to display in three Accordion Panes
which (every pane) will have a Header and a content ( Two label controls, 1 text box and 1 checkbox and 1 link button)
I am able to display data on the accrodion from database but when I am trying to Update the text in textbox by clicking link button the LINKBUTTON doesnot fire and unabel to make the update. How can we create Update event working ??
I am creating the Accordion Panes and Content controls statically and directly assigning the values to the controls from Code behind in Page Load.
I was able to do it using the "ItemCommand" event of the Accordion Panel by using the Command Name property of a Link Button which will update the Text Boxes.
It works for me now but I felt JQUERY will be a better option which has no postback, css issues..

Telerik MVC treeview - dynamically added textbox - can't click to change cursor position

I have drag drop enabled and i know that is the cause of my problem. I am allowing the tree nodes to be editable and on edit i show a textbox, but when you click in it to change the cursor position, nothing happens.
if i disable drag/drop then it is not an issue. I have tried to stop the event from bubbling up by putting click event handler for the textbox and doing preventdefault, stopPropagation, returning false, but that doesn't work.
I have also disabled the li element but that doesnt help.
Some event handler is getting called and i cannot find out which one (i have set breakpoints in all event handlers in the telerik.treeview.js but none are called when i click inside the textbox.
anybody have any idea?

Resources