I'm using the Infragistics Windows Ultragrid, version 7.3. I'm trying to use an UltraDataSource along with the LoadOnDemand mode. I have three bands defined: root, child and grandchild.
When I click on the first row, it requests the data for the child band but also requests the grandchildren rows under the first child.
Why does it happen?
I believed those items shouldn't be requested unless I click on the child band.
More info on this issue. I have spotted the ultraDataSource's InitializeRowsCollection event is raised when I'm setting up the rows number for the root band, i.e.
ultraDataSource1.Rows.SetCount(collection.Count);
In this point I haven't added yet the actual rows to the root band. Why is it requesting the items for the child band?
If I set up the bands and the data for the root band before everything, then the InitializeRowsCollection event is not raised until I do ultraGrid1.DataSource = ultraDataSource1;
But once again it is raised for the Child and GrandChild Band.
We have workarounded this by using the ultragrid's InitializeRowsCollection event rather than the UltraDataSource's. This event is fired when expected.
Regards.
Related
I am using cwebpage integrated into my program. CWebpage information can be found here:
https://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla
My question is regarding events. I currently have this setup to setup click events using get_anchors() in IHTMLDocument2. I then iterate over all of the elements to create a IDispatch in memory. This holds the event information. When an item is clicked, it sends a WM_NOTIFY to the window and then I can handle the event and parse out what I need to parse from the element that was selected.
This all works fine until I run into a page in my software with close to 50,000 anchor tags in which we run out of memory since we hold the events in memory until the the page is destroyed.
Is there a simple way to obtain the clicked element without having to set an event for each individual element? Is it possible to set a click event at a document level and then find the element that tripped it? All I am trying to do is obtain the id of the element that is clicked.
What I've tried:
I tried to just use a WM_LBUTTONDOWN message read in our browser window and then use htmlDoc2->elementFromPoint() to simply get the information that I need from the element selected. This however does not work well if the page is zoomed or wraps.
Please note this programming is in C/C++, not javascript or vb.
Thank you.
HTML events "bubble" from child elements to parent elements. So, you can simply assign a single onClick handler to the IHTMLDocument2 itself, and then use the srcElement property of the IHTMLEventObj object that is given to your handler every time on onClick event is fired by any child element on the page. See Understanding the Event Model.
We are developing QT cross platform application. Application has many functional Screens and navigations. For simplicity of handling screens we are using QT QML StackView. Each item pushed to StackView is Page. I am using following function to push and pop screens.
stackview.push(someurl); //push new url
stackview.pop(); //pop current URL or page
My Question is how can we reuse Components/Pages already pushed on to the stack?
Example : I have following screens A, B, C, D. stack is looking like A->B->C->D. Now from screen D i want to navigate to Screen A. Due to uniform architecture of the application i don't want to do 3 times pop(), instead application should reuse already pushed Screen A and bring it to top.
We can simply push the screen A to StackView (A->B->C->D->A), but we are connecting different Signal/Slot to/from each screen and it will not be good practice to connect every time screen is pushed, also don't want to grow the application StackView size.
What will be the best approach to use in this case ? Any other QT Component/Control which i can use in this case so that i can render Pages depending on Index?
We tried creating component in advance as qml Property and push it depending on URL. It is useful worked great in sample application. but in our application QML component data is closely dependent on C++ data( or some calculations at run time). Application is causing crash if we create component in advance. So we are not willing to use that approach.
property Page page1: Screen1{} //Screen1.qml
property Page page2: Screen2{} //Screen2.qml
property Page page3: Screen3{} //Screen3.qml
property Page page4: Screen4{} //Screen4.qml
Is it possible to laod Stackview component based on Index, i am not finding anything related to that in documents.
Due to uniform architecture of the application i don't want to do 3 times pop(), instead application should reuse already pushed Screen A and bring it to top.
You don't have to call pop() three times to get back to A. According to the documentation :
Item pop(Item item = undefined)
[...]
item: if specified, all items down to (but not including) item will be popped off. If item is null, all items down to (but not including) the first item will be popped. If not specified, only the current item will be popped.
Only call pop(null) once to have your stack going to the first A pushed.
An other possible approach is to use StackLayout that allow you to display QML Components based on an index.
StackLayout {
id: layout
Screen1 {}
Screen2 {}
Screen3 {}
Screen4 {}
}
Then you can select which screen appears by changing the currentIndex property : layout.currentIndex = 1 // display Screen2
Hello good people of stack overflow, I have run into a bit of a wall in creating an application. I am using custom wxPanels to display a few similar things.
What I'm having trouble doing is updating a master count when a counter in the panel is updated (the counters are wxSpinCtrl's) I can not, for the life of me, find a way to access the master spinctrl from any of the wxPanels.
I've tried passing a pointer to the master spinctrl, but when I try to access it from there I get a seg fault. I've tried setting up a custom event, but I don't know how to access the children of a wxPanel from the main panel. Does anyone have any suggestions?
You can do this several ways, but the usual way is to use an event that is triggered when the user changes the spin control value.
You do not need a custom event, the provided wxSpinEvent is fine.
You do not need to access the spinctontrol, you can get the new value from the event
void OnSpin( wxSpinEvent& event )
{
count = event.GetPosition();
}
Titanium SDK version: 1.7.0.RC1
iPhone SDK version: 4.2
I am developing an iOS app in Appcelerator. I am retrieving tweets from twitter and inserting them into a table. For each row/tweet I am also extracting the containing links for that individual tweet/row and the user can select them from an options dialog which is opened when the row is clicked.
The problem is that if I reload the page and click the row, two dialogs are open upon each other. If I click three times, three dialogs is opened and so on. How can I make sure that the dialog only opens once?
This is my code: http://pastie.org/2004091
Thankful for all help!
I had a similar problem. Especially on the iPhone 3G as this runs slowly and you're more tempted to tap things more than once. The way I got around it is to either remove the event listener from within the event listener itself. Or you set a variable and test for its value in the event listener. So, if you set a variable call 'clicked' to false. When the listener is first check for 'clicked' = false, if it is set it to true so next time the code is not executed.
Got an annoying issue.
When a user edits a field on an item, we use a OnSavingItem event handler to create some new items elsewhere in the background as it were.
Problem is the item the users edited the field of gets redirected to the item we invisible created in the background.
We want it to stay where it is... Any ideas?
thanks
If you want to disable the transfer to the item you've just created you could also consider implementing the following code:
// Before we copy the item we put notifications on to make sure we won't be transfered to the newly created item
Sitecore.Client.Site.Notifications.Disabled = true;
// Your action comes here
Sitecore.Client.Site.Notifications.Disabled = false;
Are you using the
<event name="item:saved">
Handler? If so, don't forget that this event is fired on all the new items you create as well, potentially triggering a recursive event loop.
This answer came from the SiteCore forum ... credit goes to John West
I think you could use the item:saving event or the saveUI pipeline. Use the event if you need to handle changes that occur through APIs, or use the pipeline if you only need to handle changes that occur through the user interface.
You could also consider adding the logic to the field itself.
John West Sitecore Blog
item:saved is much heavier than a processor within the saveUI pipeline. For example, item:saved is triggered during publishing which is not what you really want. I always recommend handling such customizations either on the pipeline or workflow action level.