I'm trying to make dropdown list with columns' headers that have functionality, which lets you hide or show the column in the table just by clicking. I'd like to ask, if there is any possibility to hide/show columns(fields) in the Odoo's table dynamically?
I have tried with field_view_get, but it wont work. It's just "undefined".
Tree view columns can be hidden statically in the field definition
<field name="description" invisible="1"/>
The column values can be hidden dynamically
<field name="description" attrs="{'invisible': [('hide_description', '=', True)]'"/>
As far as I know, it's not possible to hide the entire column dynamically. You might be able to achieve it with JS or by using the Action menu to load a wizard to show/hide columns where the "Apply" button on the wizard actually manipulates a ir.ui.view for the user?
Related
I have create a Many2Many field and I want to hide/remove create option which is showing when we are clicking on Add an item. I have added screenshot for reference. Link for screenshot
Options
no_create - remove the “Create” button.
no_quick_create - remove the Create and edit... option
Example
<field name="field_name" options="{'no_create': True}"/>
for more information you can use this link
Form widgets for many2many fields in Odoo
I have used a selection widget in my program and it has lot of items in the drop down. Is there any method to enable typing on it so user can select item easily. (just like making a JComboBox editable in java)
If you are using the many2one field with the widget="selection", you can select the selection box by clicking it and you start typing what you are looking for, the box change to the value that you are writing. By the way, you must write it fast and the drop down must not be deployed.
The other option is to use a many2one field without the selection widget. You can install the community module web_m2x_options and use the limit attibute to avoid the option "Search More". Like this you can write in the box to find the elements. For example, you can show until 10 elements without the option "Search More" with this example:
<field name="example_id" options="{'create': False, 'create_edit': False, 'limit': 10}" />
When defining the properties of a custom control in the "Property Definition" section, you can choose as "Type" in the "Property" tab the option of "extraColumn" and "iconColumn".
How should this type be used ?
Both iconColumn and extraColumn relate to the corresponding tags of the dataView control. You would typically use these when your custom control contains a dataView and you wish to allow an outside control to pass in details about the columns to be used in the dataView.
When a data view is used in a standard XPage, the extraColumns appear as actual columns. The summaryColumn is the first column and shows as a link.
However, in a mobile application, extra columns show up as additional lines of data in the mobile data row. The summaryColumn value shows as "header" in the data row, while the extraColumn values show underneath that value.
<xe:dataView id="dataView1" pageName="#contactDetails" collapsibleDetail="true">
<xe:this.data>
<xp:dominoView var="view1" viewName="TeamDirectoryNameLU">
</xp:dominoView>
</xe:this.data>
<xe:this.summaryColumn>
<xe:viewSummaryColumn columnName="Name"></xe:viewSummaryColumn>
</xe:this.summaryColumn>
<xe:this.extraColumns>
<xe:viewExtraColumn columnName="Office" style="font-size:12pt"></xe:viewExtraColumn>
<xe:viewExtraColumn columnName="OfficePhone" style="font-size:12pt"></xe:viewExtraColumn>
<xe:viewExtraColumn columnName="Email" style="font-size:12pt"></xe:viewExtraColumn>
</xe:this.extraColumns>
</xe:dataView>
One row of that might display as:
Ian Kennedy
London Office
44-22-830-6000
ian.kennedy#company.co.uk
I have a grid control displaying data about a Company. I want one column to be "Employee". On click on the any cell of "Employee" column I want to pop up the one Form called "Employee Details" and would like to feel the data.
How can I do this?
As I understand the modal form on click of a jqgrid cell deals with data only related to that row. I want to show different data on the pop up form, i.e. other than the grid data.
Pl help.
Shivali
Probably you can use unobtrusive links in the column (see this and this answers). The advantage of this technique is that instead of typical links you can define any custom action on click on the link. The look of the link can be defined by CSS, but it seems to the that the link can show the user better as other HTML elements, that the user can click on it.
Alternative you can use a button in the column with respect of the custom formatter, but with the same technique as described before you can free define which action will be done on the click.
Inside of the click event with the parameter 'e' you have e.currentTarget as the DOM element of <a> for the link or <input> or <button> if you use buttons in the grid column. To find the row id you can use var row = $(e.currentTarget).closest("tr.jqgrow") or var row = $(e.target).closest("tr.jqgrow") to find the <tr> element. The row id will be row[0].id.
I have a datagridview on a windows form. It has clolumn [EmployeeNumber, EmployeeName and EmployeeDepartment].
I want to be able to edit values directly in the grid but i want EmployeeDepartment to be a combobox column, such that on cell edit, a combobox shows up with available options for the employee department. Has any one been able to implement such functionality?
The DataGridView actually has a DataGridViewComboBoxColumn. If you go to the column designer, and add a new column you'll notice you can select one of a few types. It behaves exactly as you have described - on edit, it appears. The DataGridView uses things called editing controls, and has various events for swapping the control into the cell on edit.
Either way, if all you want is a drop-down, that's available out of the box.
To populate the combo box with items, in the column editor you will notice that it has an Items property for manually setting items, or you can use the data binding properties: DataSource, DisplayMember, ValueMember. Data-binding has issues when an expected value is not in the items collection, you will get a lot of cell errors; but they can be avoided.
Some helpful links:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.aspx
http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/e8e2d9eb-fe39-42ab-9a18-2194dac54675/