How to disable drag and drop feature in ExtGWT - gxt

I am using EditorGrid in ExtGWT. currently DnD feature is enabled. i want desable in particular context. please help me how to achieve this.
Thanks!

You can call DropTarget's disable() OR DragSource's disable() method to either disable Dragging OR Dropping.
You can also change the "group" field of DropTarget or DragSource (using setGroup) to have a mistmatch between both of them to disable DnD.

Related

Can we conditionally hide "Help" menu options in Maximo start center?

Is it possible to hide help menu options conditionally in Maximo start center. I have tried by associating sigoption and condition to a help menu item in MENUS.xml but it doesn't work.
Personally, I don't think it makes sense to do this particularly since the Maximo help is available online anyway but that being said, if you're intent on going ahead with your requirement, one option is to use the help grid control in place of the help menu.
You could add help grid controls to the application screen(s) you wish to provide help for and set the HTML Content property of the control to some relevant help text then use the More Information property of the control to link to the Out of the Box help file, for example:
com.ibm.mbs.doc,company/c_companies_application.html
You can get the appropriate text for the More Information property for the Help Grid control from the existing Application Help property value of the Application's Presentation properties. By removing the Application Help property value the Help menu item for the application will no longer function.
The help grid control can also have a Signature Option and conditional properties.

How can I disable selected attribute from select2() dropdown Jquery?

I know how to enable the selected attribute from dropdown; I can use this code :
$('select').select2();
but my problem is how to disable it ? thx
The right way for Select2 3.x is:
$('select').select2("enable", false)
This works fine.
For those using Select2 4.x, you can disable an individual option by doing:
$('select option:selected').prop('disabled', true);
For those using Select2 4.x, you can disable the entire dropdown with:
$('select').prop('disabled', true);
The below code also works fine for Select2 3.x
For Enable Select Box:
$('#foo').select2('enable');
For Disable Select Box:
$('#foo').select2('disable');
jsfiddle: http://jsfiddle.net/DcunN/
To disable the complete select2 box, that is no deletion of already selected values and no new insertion, use:
$("id-select2").prop("disabled", true);
where id-select2 is the unique id of select2. you can also use any particular class if defined to address the dropdown.
In selec2 site you can see options. There is "disabled" option for api. You can use like :
$('#foo').select2({
disabled: true
});
As of Select2 4.1, they've removed support for .enable
$("select").prop("disabled", true); // instead of $("select").enable(false);
From: https://select2.org/upgrading/migrating-from-35
As the question seems unclear, I'm sorry if this answer is not directly related to the original intent.
For those using Select2 version 4+ and according to official plugin documentation, .select2("enable")is not the way to go anymore for disabling the select box (not a single option of it). It will even be completely removed from version 4.1 onward.
Quoted directy from the documentation (see https://select2.org/upgrading/migrating-from-35#select2-enable):
Select2 will respect the disabled property of the underlying select element. In order to enable or disable Select2, you should call .prop('disabled', true/false) on the element. Support for the old methods will be completely removed in Select2 4.1.
So in the previous answer's example, it should be:
$('select').prop(disabled,true);
As per select2 documentation: Click Here
If you wants to disable select2 then use this approach:
$(".js-example-disabled").prop("disabled", true);
If you wants to enable a disabled select2 box use this approach:
$(".js-example-disabled").prop("disabled", false);
I'm disabling select2 with:
$('select').select2("enable",false);
And enabling it with
$('select').select2("enable");
$('select').select2('enable',false);
This works for me.
I'm disable on value:
<option disabled="disabled">value</option>
if you want to disable the values of the dropdown
$('select option:not(selected)').prop('disabled', true);
$('select').prop('disabled', true);

Openerp: How to disable a side menu(More) in form view while using ir.actions.server

I want to disable a menu from "More" options in form view while using action type "ir.actions.server".
How can i make it possible?
In case of action type "ir.actions.act_window" we can do it by multi = True. Is there any equivalent attribute or something exists for this?
Thanx in advance.
As siddharth jambukiya said, we can use a web module to do his. But there is an another method that can be done from python. If you look at the result of the function field_view_get of the model to which the server action belong, you an see that there is a key called "toolbar" in the fields_view_get result. This key contains all the details regarding the action in the "Print" and "More" dropdown in web client. So if you remove the server action from here, that server action wont be listed in the "More" dropdown.
You can remove any Menu from "More" using web client. you need to implement web module to remove option from More menu. i think no other alternative attribute exists in openerp.

compute dynamically the allowDelete property of file download xpages

I am using a file download control and I would like to set the value of the "allowDelete" property dynamically depending on whether the document is in edit or read mode. However, this
property is computed onload of the page. I tried calling the function "setAllowDelete(boolean)" on the onclick event of a button or the "beforeRenderResponse" event of a custom control and a partial or full update to change the value of the property, but it didn't change.
Do you know if there is a way to do this?
Thanks a lot in advance!
I have encountered the same problem. There are two options to workaround it.
1) To use two controls, one with deletion enabled, the other with deletion disabled, and use rendered properties according to edit state (or user role).
2) Render download controls by your own, as data table or repeat. However, this solution has its own problems, too.
Have you tried just calculating the property like this?
<xp:fileDownload .... >
<xp:this.allowDelete><![CDATA[${javascript:
return document.isEditable()}]]>
</xp:this.allowDelete>
</xp:fileDownload>

wxgrid , Detecting Scroll event

I have created a wxGrid with custom table. Whenever the user scrolls down to very bottom of the grid, I have to load the next 100 rows from my table. I tried EVT_SCROLL_BOTTOM() but I am not able to detect it. What is the right thing to do? Thanks.
I don't know the answer to your question but I am reminded that the grid was designed to work with an object of type wxGridTableBase that can be extended by the application. By extending this class, you should be able to do whatever caching you want inside of the extended object.
You could bind the scroll win event for the grid. I have encountered almost the same requirement as you. :)
self.Bind(wx.EVT_SCROLLWIN, self.OnScroll)

Resources