LightSwitch dynamic cascading dropdown lists - dynamic

In lightswitch, I need to make dynamic cascading dropdown lists based on a recursive relationship:
Table "Categories" includes:
Id
Name
ParentId
here is the desired scenario:
a screen showing a drop down list for the categories with no parent
(ParentId = Null).
once user selects a specific category, another
drop down to be created which includes the selected category
children.
User can select another child category, and show another
dynamic dropdown, and so on till we have categories drop down with
no children.
Thanks & I really appreciate your help with this.

I miss also tree controls in lightswitch, for this reason, I have developed my own:
LightSwitch Custom Control: Tree CRUD Operations
LightSwitch Custom Control: Tree lookup Operations
Be free to get source code and video samples from this links.
Here my control playing with a 2,4Millions nodes tree

Related

How to order rows when custom model is made from GUI in Odoo v 10?

I have made a custom model using GUI. This model contains a field named sequence.
I want to order my rows by this field.
This same this has been done for res.company model and i want the same.
So, for companies
_order = 'sequence, name' is written in model.
and widget='handle' is used in tree view that orders various companies just by drag and drop.
So, i added this widget attribute in my tree view, but i don't know where to use _order='sequence'(the field I created in my model) because i don't have code for that model.
Is there a way that i can do i from GUI itself or I need to create that model from code??

Managing PerformancePoint Filters With Slowly Changing Dimensions

Just a bit of background info:
I have dimension table which uses SCD2 to track user changes in our company (team changes, job title changes etc) See example below:
I've built an Analysis Services Cube and created all the necessary hierarchy's for the dimensions and it works well when navigating and drilling down through the fact table.
The problem I have is with the filters on the PerformancePoint dashboard. As I'm using the User Dimension table with it's multiple instances of users it's showing duplicates up in the list. I can understand why as the surrogate ID is being referenced on the Dimension. But if I choose the first instance of the A-team I will see all their sales for a particular period and if I choose the second instance I will see all their sales for a different period.
What is the best way to handle this type of behavior? Ideally I'd like to see a distinct list of teams in alphabetical order and when I choose the team name it shows all of their data over time.
I've considered using MDX query filters but I'd like to see if there's anything I haven't thought about.
I realise this isn't an easy and quick question but any help would be appreciated!
The answer was simple after having a trawl through my User Dimension table on the Cube.
Under my user dimension I added 2 duplicate attributes to my attributes list ("Team Filter" is a copy of "Team", "User Filter" a copy of "User Name") these will be used only for filtering the dashboard.
Under the attribute properties for each duplicate I then set AttributeHierarchyOptimizedState to "Not Optimized", I also set their AttributeHierarchyVisible to false as I'd shown the two duplicate attributes in the hierarchy window in the middle.
Deploy your Cube to the server and go in to PerformancePoint. Create a new MDX Filter (this image shows the finished filter)
This is the code I used, it only shows dimension members which have a fact against them (reduces the list a considerable amount) and by using allmembers at the dimension it also gives me the option to show "All" at the top of the list.
Deploy the new filters and now you can see the distinct list of users and teams, works perfectly and selects every instance (regardless of the SCD2 row)

Creating the form for a m2m-relation in MS Access 2010

I have the following data-scheme:
I've made two forms, for the tables "Flats" and "Owners".
Now, i need to be able to edit "Owners" table inside the "Flats" table context, e.g. add new/remove old Owners
Is there any standard method to do that in Access 2010 without using VBA?
To add new items, create a form for FlatOwners and add two dropdown fields with rowsource set to flats and owners. If you want to create flats and owners in the same form use subforms in the same manner (as suggested by Gord).
If you want to view the owners of a specific flat or the flats of a specific owner you'd need separate forms/reports that bind to flats/owners and have subforms that bind to queries: a form "FLATS" would have a subforrm which binds to a query with FlatOwners.OwnerId and all of the Owners fields (in SQL: SELECT FlatOwners.OwnerID, Owner.Name, Owner.Surname FROM FlatOwners INNER JOIN Owners WHERE FlatOwners.OwnerID=Owners.OwnerID

Access Main View data from ajax partial view

Situation:
Let say we have a list of products and each with a bunch of orders. I have a my index view that has this list of products contained in the model. I iterate over the list and display a list of products on the page. I add an jquery click event for each project, the click event loads a partial view for each order beneith the product list.
Order partial view would look like this:
#model Order
<p>#Model.orderNum</p>
#Html.DropDownListFor(Order.CustomerName,CustomerNameList)
<input type="submit"/>
Index view would look like this:
#model List<Products>
#foreach(Product p in #Model)
{<button class="product-button">#p.productId</button>}
<div id="orderDiv"/>
then I would execute the following javascript for every order for the product:
$("#orderDiv").append($("<div></div>).load("MyController/Order/[order ID would go here]"));
This would load an order with a seperate partial view for each order id the product had.
Problem:
The simple solution would be to have the CustomerNameList in the Order Model. However, I don't want to load that data to the page so many times. Is there a way I can put it in the ViewBag or store it somewhere else so this list is available to the whole page?
Notes:
I don't want to use one partial view for all of the orders (ie. have the order view model be a list and iterate over it in the partial view) because I want to be able to submit each order individually (to save it)
I also might need to use this list of Customers on some other part of my page. I would like to keep it available. For example maybe I have a button that says new order and this uses ajax to load a parital view and that partial view also needs the customer list. I don't want to send that data to the page so manye times.
Can I do this?
Is this just a bad way to do this?
Not too sure why you would want to load a dropdown list of users, for already, existing orders. That means you are wanting the facility to change WHO made the order?
However, if you must, you can load your customer dropdown list as an empty dropdown with a class of customer, you can then make an internal call to get the json for customer, and then load up all your instances of class customer, with the data from your json call of customer data.
This would allow you to have 50 orders listed, with one single collection of customers data.
personally though, you should have relationships with your models using foreign keys, or using a viewmodel that would already add in your customers list, you would also only wish to show full order details to a user, if they clicked on the row to show full details.
Even if someone goes mental on the screen and clicks all 50 to look at, you should still be able to handle these request without much trouble, otherwise and likewise you wont be able to have 50 customers all looking at there baskets at the same time, or 50 customers all searching the products database at once!

Ruby on Rails 3 - Modeling Products with Many Categories / Attributes

I am working on my first Rails website, a sort of shopping website: there are products sold through the website, each with multiple unique attributes.
The use case I am imagining is: a user visits the site looking to buy a used bed, they click through several higher categories until they find a bed of the correct size, something like this:
Furniture
---> Couch
---> Dresser
---> Bed
-------> Size
----------> King
----------> Queen
...
At each time the user clicks a more narrow category, they are supplied a menu with the next level of detail (a la NewEgg). When "Furniture" is clicked, all furniture is displayed, and a menu with the types of furniture appears. When "Bed" is clicked, all beds are displayed, and a menu showing the various attributes of a bed appears, etc.
So far, I have an "Item" parent class which contains all the attributes of every item sold through the website (price, description, etc...). I am stuck with what to do next.
My first instinct is to have subclasses, but they don't seem to be that useful. There is nothing about the "Furniture" subclass that would have anything new in it, other than definiting it to be furniture. Also, each parent class needs to know about its subclasses.
What sort of design pattern should I pursue to cleanly implement this model? I've been looking into nested sets, but I am not completely sure that's the way to go. Any guidance is appreciated.
Thanks!
Your categories clearly form a tree, which is probably why you're thinking about a class inheritance tree. However, you are correct that this isn't the right model, since subclasses do not add any functionality over their parents.
You should have a single "Item" class, which is a node in the category tree - with references to its parent category (another "Item", or null for the root) and its array of children (all "Item"s).
The correct place to store the information about the tree structure is the database. In your items table, add a "parent_id" column as a foreign key - to the items table.
As the user navigates down in the tree you show the subcategories by querying for the items whose parent_id equals the current item id.