XamDataGrid Parent Amount should be auto update - infragistics

It seems like that it would be easy but i m having trouble finding the right way to do it.
I am using XamDataGrid and the hierarchy high level look like this.
Account ,Amount --> Sub Account Amount
Here is the screen that help you to understand clearly
My question is that When i edit the sub accounts amount it should be automatically sums up to it parent amount
Here is the XAML,
Any help would be highly appreciated.

This is more of a comment, but I don't have the rep yet.
I can't see how you're binding to your ViewModel, but I would imagine that the ViewModel has the correct values, but you need to tell the View to update. My ViewModelBase class implements INotifyPropertyChanged and so in my case I would need to call RaisePropertyChanged on the ViewModel property that represents the parent row.
If this doesn't work, please post a simple, stripped-down example.

Related

django-river: example of change in state from a view

I am trying to use django-river to track and control the flow of objects in my application.
In particular, I have objects representing document that will pass from the author to a reviewer and then on to a production team, ideally based on a view controlled by a button press. I was intending to have an owner field that could be changed to indicate who currently 'has' the document.
Can someone please give me a short example of how this might work?
Thank you!

Ember.js having more than one view per controller/model

I have a controller and a model that get some data from the server.
I'm trying to initialize two views, one for editing and one for showing a list of items related to this data. For example, the model holds some search properties which the user may edit. After editing the search params I want to switch between the two views and display the refined search results.
I can't find any sample that does such switching.
I tried using Ember.ContainerView samples but all seems to be failing with nasty runtime errors.
Not sure that I have any relevant code sample :-(
Any help would be gladly appreciated
I've put together a demo that toggles editing, nothing special but it simulates your use case I guess, have a look here.
Hope it helps.

Dynamic Binding in <option> inside Ember.Select

If you look at my brief history of questions, I've seem to have built up a reputation for asking simple questions that I should have figured out the answers to myself, before wasting people's time. With this one though I'm genuinely stumped and I would greatly appreciate some help, so here goes...
I have a multi select list (will eventually use a jquery plugin to make it pretty) that will be populated based on some user criteria (in my example the options are hardcoded, but an example would be a 13 year old shouldn't be able to see rated "Mature" games in my game store).
Based on some search criteria (let's say we are searching by publisher, games available in a specific country, etc..) The counts for each multi-select item, should update as the search criteria changes and the counts change. (In my example I just change a value with a timer)
Here is the fiddle, http://jsfiddle.net/AMPBb/1/
It seems like there are a few ways I could solve this, like a countBinding on my SelectListItem with a displayText computed property, but I can't actually finish a working example. The first option that has the changing count is very hackerish, but demonstrates the functionality that I'm expecting. I haven't come across an example like this before, so I'm very interested in seeing what the best approach to solving this should be.
Thanks in advance for any help.
I would create a computed property label on your App.SelectListItem which is defined as follows, see http://jsfiddle.net/pangratz666/Y6467/
label: function() {
var text = this.get('text');
var value = this.get('value');
return '%# (%#)'.fmt(text, value);
}.property('text', 'value').cacheable()
Also note that you have to create a valueBinding to your 'App.CountModel.*' in your App.SelectListItem.
One more thing about naming convention: concrete instances should be named in lowerCase, so it's App.countModel. See http://www.emberist.com/2012/04/09/naming-conventions.html.

Backbone, selectively render parts in template

I am listing products as table rows, each row contains input fields for specifying the quantity of products.
I made a Fiddle for it here, http://jsfiddle.net/kroofy/4jTa8/19/
As you can see, after the input in the Qty field have been made, the whole row render again. And because of that the focus of the input field will be lost, which is not good if you want to input more than just one digit, or tab between input fields.
What would be the most elegant way to solve this?
I would handle this by setting model.set({qty: _qty}, {silent: true}) and then updating the non-input fields with this.$.
As an alternative to the silent treatment: rather than listening for change events, listen for change:qty and change:sellPrice and have a method that updates just the HTML that needs updating within this.$, rather than re-rendering the DOM object and breaking your focus.
Either way, your comment about "selective updating" on the fiddle is certainly the right way to go.
(this.$ is a backbone hack to jQuery that restricts all selectors to search only within the DOM of the View's element. The element doesn't even need an ID or class; it just needs to exist and the View maintains a handle to it. It's incredibly useful.)
i built a plugin for backbone called Backbone.ModelBinding that may be able to help in this situation. my plugin allows you to update portions of a view with data from a model, when the model changes.
i've forked / updated your fiddle to show it in action: http://jsfiddle.net/derickbailey/FEcyF/6/
i removed the binding to the model change. i've also added id attributes to the inputs of the form to facilitate the plugin (the attribute that the plugin uses is configurable, though). and lastly, i've added a data-bind attribute to the sell price total td.
you can get the plugin here: http://github.com/derickbailey/backbone.modelbinding/
hope that helps
FWIW: my plugin is an automated version of what Elf is suggesting. I've written code exactly like he is describing, numerous times, which is where the plugin came from. I just got tired of writing that code by hand :)

Best solution for managing navigation (and marking currently active item) in CakePHP

So I have been looking around for a couple hours for a solid solution to handling site navigation in CakePHP. Over the course of a dozen projects, I have rigged together something that works for each one, but what I'm looking for is ideally a CakePHP plugin that handles the following:
Navigation Model
Component for handing off to the view
Element View Helper for displaying the navigation (with control over sublevels displayed and automatically determining the "active" item based on URL and/or controller/model/slug
Admin pages for managing a tree of navigation
Any suggestions for an all-in-one solution or even the individual components would be very appreciated! Or even suggestions on how you have handled it in the past
We had this issue at work recently and i ended up whiping up a helper that would take query from the contents table and convert that into a menu. As it needed to become more flexible the code got worse and worse up to the point where i am currently rewriting it.
Don't hold your breath though as i will be taking my time to make it work right as it needs to be very flexible but it cant be confusing to use.