The doc says there should be a gridOptions.showToolPanel(show) function, but in the actual object there is only a Boolean property. You can set this property true, but this has no effect on the grid.
What's the proper way to show/hide the tool panel from code?
Searched through code:
gridApi.showToolPanel(true);
Edit: or gridOptions.api.showToolPanel(true);
..if you identify [gridOptions] in your ag-grid tag.
Related
I am using angular Kendo combo box. I want to make that combo box as read only. I am trying to use the attribute readonly="true". But it is not working. Could anyone suggest what is the attribute for it. Code for the following:
<kendo-combobox
[data]="data"
[textField]="'desc'"
[valueField]="'name'"
[(ngModel)]="selectedValue"
[valuePrimitive]="true"
(readonly)="true">
</kendo-combobox>
I think you just need square brackets instead of parentheses:
[readonly]="true"
According to the Angular documentation:
An element property between enclosing square brackets identifies the target property ... Event binding syntax consists of a target event name within parentheses
The combobox documentation includes a readonly property, so it should work (apologies, I can't currently check it, not having a working angular project).
I am unable to fire OnItemClicklistner method on clicking on Checkbox (in my List-view), i have tried following way...
i have set the focusability and clickability to false as follows.
android:focusable="false"
android:clickable="false"
android:focusableInTouchMode="false"
It fires the OnItemClicklistner but doesn't send reference of Checkbox in view parameter. Please help on this.
Please look at Google documentation at CheckBox class.
Checkbox does not have OnItemClicklistener. You may be getting events from a different UI element, hence confusing you. Checkbox has setOnClickListener method for you to use. Remember documentation is there to help you.
I have an array of objects that I want to show in ng-grid. Each row has a boolean property isVisible. In the ng-grid I want to show only the rows where isVisible is true. The other rows should be completely hidden.
I have tried using a rowTemplate and databinding a ng-show to isVisible. That hides the content of the row, but leaves the actual row in place, showing an empty row.
I have tried using filterOptions, but can't figure out the correct syntax to do such a filtering. I couldn't find any good documentation on how to set it.
I have even tried modifying the gridTemplate in the ng-grid source, by trying to add a filter on ng-repeat=\"row in renderedRows\", but I haven't gotten that to work either.
I guess I could modify the array itself, by temporarily removing rows, but I would prefer not to do it that way, since I have to be able to show the rows again (It is actually an expander that I'm doing, that should hide/show sub-rows)
Try also conditionally setting the height of the row in the template to '0' based on isVisible or use a CSS class with ng-class. Play with the CSS of it until you get the desired effect and then you can use that in your template.
This sounds like the type of thing that would benefit from using height and CSS animations actually so it opens and closes with an animated style. If you have a jsFiddle sample I'd be happy to try and help.
Edit: After looking at how the grid actually lays out it's rows (absolutely positioned) you only really have two options I can think of:
1) Filter the data you are binding to the grid through a function like dataVisible() but keep the full data list internally in the controller so you can show/hide easily
2) Submit a patch to the ng-grid project (or fork it) with the filtering capability you are looking for. Out of the box it doesn't appear to support this scenario.
I'm actually not sure if this is possible, but I will ask it anyway. I have a group of accordion controls, and within the content body of each I need to display a grid panel. The grid panel needs to have a click event attached to it. I have tried simply creating the grid panel and setting the html property of the accordion to it, but this produces no content.
Is there somehow I can achieve the above?
You cannot have html content (inserted by the property) along with any other content. If you add any item the html property value will not set/overriden. But for sure you can place anything you want into one accordion panel. Even a grid. But for that case, and based on the last question, I would recommend you to reference the view into the grid. You may do this simply by using a ComponentQuery
The click events can be applied by using the control function of the controller.
For your basic understanding:
In ExtJS you seldom use plain html code. In most scenarios you use any sort of component. All is nested within the items-array or dockedItem-array. Items within these arrays get also processed by the layout system.
Some Query examples applicable to the control function
In the following this refers to the controller itself.
You know the Id of the grid (normally you didn't do this). Id's are marke by a starting #
control({'#yourId': {itemclick: this.onItemclick }});
You know the xtype and that there is only one instance of this type. You can also describe a path by using spaces between the xtypes.
control({'grid': {itemclick: this.onItemclick }});
You have set a custom property to grid (you can refer any property this way). This one is fully compatible the the one above. I recommend this one in your case
control({'grid[customIdent=accordionGrid]': {itemclick: this.onItemclick }});
This are just some ways to use ComponentQueries, there are more. For a more detailed explanation you should refer the sencha API for ComponentQuery
Also note that every component implements the up() and down() methods which also support ComponentQueries.
I forgot to mention: For a control the query strictly need to return just one result (only the first one will be taken) a ComponentQuery on the other hand can return multiple results.
This is perfectly possible but the accordion's body is not the place to put that in. You'll need to add it to the items: [] array of the accodion. The body (or html) only accepts html.
Example:
http://docs.sencha.com/ext-js/4-1/#!/example/layout/accordion.html
this one has a grid within it.
My ExtJS grid is attached with action tbar, now in the handler of the toolbar buttons I need to have the grid instance. One way I can do it using
this.findByParentByType("grid"). Is there any better way that I can get the grid instance??
You can also use the ownerCt var to access the parent element. Based on the nesting level you will minimal need ownerCt.ownerCt from the button instance to access the grid. FindParentByType does basicly the same and checks each type. Firebug and console.log will help you with further debuging. EDIT:I forgot the Ext.getCmp that can be used to find an object by it's id.
You can also get parent grid by giving scope scope:this to toolbar button, then in handler you will get grid instance in 'this' variable.