combo with search and button-reusable in extjs - extjs

i am using a factory function (which has grids within windows called using button handler)within one form.
so when i click the button and open a grid and than close it,it works correctly,
but say for example in a situation:
if i open both grids and close , and than try to open other grid the previous grids contents are loaded,but as i have set the store to load in button handler that particular store is loading correctly(i have checked with fire bug) but contents of grid are not changing
win.hide();//use to hide the window after using it
closeAction: 'hide',//in window config

I am assuming that you are using gridpanels for each of these grids. You could force the stores to reload(). Or on the Window's close or hide event, you could try and clear the data on the store or reset the gridpanel.
You may want to read up on the closeAction property on the Window object. That lets you define the behavior of the close button on the window.

Related

How to open modal wpf window scoped to a tab item

I have a use case where we have an application with a tabcontrol with 2 or more tab items . I want to be able to open a modal Window (using Window.showDialogue()) so the user is blocked to do any thing else within the active tab item from where the modal window was opened . But should be able to click on other tab item and continue to do the work .
Currently Window.showDialogue() completely blocks all user interactions until the window is closed . Is it possible to change the scope of the blocking window to just the initiating tab item ?
As an alternative , I have a overlay design to show the popup content using the Panel.Zindex and then disable the underlying controls container . But I would prefer to do the simple way of window.showdialogue().
Any help would be appreciated.
As far as I know, here is no way to block only part of a Window when calling ShowDialog. The blocking is done at the Window level by the OS. You'll have to manually disable that tab.
Be aware that if you simply put another element on top of the tab to obscure it, the user may still be able to access the controls below by using the Tab key. You might need to set IsEnabled to false, or maybe IsHitTestVisible, depending on the how you want the application to behave.

Angular UI-grid options

Currently I have a grid that has a option to click and show the grid options on the far right side. The issue I'm having and I am wondering if there is a setting I can add for the grid options dropdown to automatically close when a user clicks off anywhere else or opens one of the column drop down options. Any ideas?
There does not appear to be a setting for this in the API. I assume you are using CellNav, which is the cause of this. The reason clicking on the grid cells or header cells doesn't close the grid menu is that cellnav is eating the click event.
If you are using CellNav, you may notice that the column menus do not close when clicking within cells, either.
You need to add a different event listener (let's go with mouseup) and programmatically close the menus.
Here is an example of how to achieve this using the gridApi and onRegisterApi grid option.

Extjs 4.1 window.close() does not destroy it

I create an object of window, and put tabpanel in this window. but window.close() method does not destroy window. When I click button to open window again it display 2 different tabpanel, one from old window and another from new window and it crash my user interface.
I also called listener "beforeclose" and in this method destroy tabpanel but that doest not work.
What can be done?
Are you sure that closeAction option is set to destroy?
Of course it is a good idea to show simplified sources, so we can understand where the problem exists.
Add closeAction:'destroy' to your window. It should work.

Sizing panels in an ItemsControl

I have a parent view model, that contains a collection of other view models (of same type) (children). On Initialization the number of children will be decided (varying).
The child View consists of a button and a list box. Initially the listbox is hidden. On click of button the list box appears and on clicking outside (outside of the control or any other child button).
On init only buttons will be shown. I want these buttons to be spaced across the available width. The requirement is that once the button is clicked (when listbox is shown) the width of the whole child will increase (lets say 350) and when it is hidden it reverts back to the original size.
In the parent i am using a ItemsControl to show the children views. I have tried all controls but not able to figure ou a appropriate solution for this. I have two issues:
On Button click i am able to show current listbox. If i click another button teh first one goes off. Till here it works fine. But i also need that the currentopen listbox closes on click anywhere outside of the control (child control)
How to automatically size and resize based on what is clicked . First all should be propotionately sized and then when one is clicked it's size increases (here other childs resize with the rest available space). When the one (open control) is collapsed, all of them come back to normal proptionate sizes.
Any ideas ?
BTW, i am using MVVM pattern for this.
how about using a flag to direct the view to perform calc and refresh/readjust the sizing as when needed.
like on-click routine, set the flag on
whenever the view (pre-)painting/drawing event is kicked in, check if the flag is on, do the calc and sizing, then off the flag.

Ext: bind formpanel after datastores for combo's have loaded

In an Ext Js-application I am working on I have a formpanel that contains (among other controls) three comboboxes, each with a different datastore. I need to load the form with existing data and display that in the form. This works for all simpel controls (textboxes, checkboxes) but there is a problem with the comboboxes.
The comboboxes each use a datastore but I can see that there is only one store loaded before the form loads its own data, causing that one combobox to display the correct text and the other two the value. If I click and close the combobox without making a selection the correct text appears.
Is there a way to either delay the loading of the form or the binding of the form until all datastores have loaded? The datastores are local stores with autoload and the formpanel calls its own load in the afterlayout-event.
The problem is that the setValue executed by loading your form is executed before the stores of the combo boxes are actually loaded.
You could try to implement the fix condor and animal of ExtJS have propsed in this forum thread on sencha.com: http://www.sencha.com/forum/showthread.php?75751-OPEN-42-ComboBox-s-setValue-call-with-a-remotely-loaded-Store
It basically just delays the setValue call on any combobox until the store of the combobox is fully loaded.
Load the form panel after the rendering is complete. Is there any specific reason you are loading the form in afterlayout event?
Load the form in afterrender event rather than afterlayout. the afterrender event happens when all form is completely rendered.

Resources