I am not sure what i want is existing yet. I am using Extjs4+.
So i want convert bellow tree to group button [Students(drop down menu),Teachers (drop down menu),Staff (drop down menu)] i want something like Microsoft word menu.
Current tree:
- Students
- Student List
- Student Absence List
- Teachers
- Teacher List
- Teacher Absence List
- Staff
- Staff List
- Staff Absence List
//Three data respond from server with Json.
Related
I'm trying to build a strapi component which would render items grouped by category. What I actually try:
Having Meals grouped by different categories I want to have a list as it follows:
MealCategory_1:
- Meal1
- Meal2
MealCategory_2:
- Meal1
- Meal4
- Meal5
So for now I have a component where I can select multiple Categories which should fetch related meals
What should I override in controller to have the desired result?
I need help to model a database in MongoDB.
The model below shows performance problems.
- Collection users
- email
- hash
- store
- name
- adress
- logo
- products
- name
- value
- description
- image
- featured
- categories
- id_category
- Collection category
- id
- name
In the system the user can have a shop and the shop have many products and the products have many categories.
The problem is when I want to put a product featured on the home page , the system will search for all users , which is not good.
I thought about putting the products in another collection , but that would think of " relational " mode, which MongoDB is not .
You can do relational in MongoDB it just isn't build with that in mind so you will have to pay attentions to the things that relational databases would usually pay attention to for you and you will also have to work arround things that are missing like joins. But that doesn't mean you can't do relational and if you look at your schema you are already doing the categories relational.
Also since you are storing images with the product and a shop can have a lot of products you will probably run into the 16MB document size limit sooner or later.
A product collection is probably the right way for you given the information from the question.
Since your user have many products, I think its better to put "product" in another collection.
Note that MongoDB has a limit of 16 MB for a single document.
You can do something like the following:
- Collection users
- email
- hash
- store
- name
- adress
- logo
- products :[product1ID, product2ID,...]
- Collection Product
- ProductID
- name
- value
- description
- image
- featured
- categories
- id_category
- Collection category
- id
- name
Embedded document model is not a good choice for many-to-many relation. Using normalized data model can clarify the schema, save disk space. Although you would have to run multiple queries for a "JOIN".
For more detail, you can read the data model section of the official manual:http://docs.mongodb.org/manual/core/data-modeling-introduction/
Our factory rates employees by using 5 ranks:
rank1 - Uncertified
rank2 - Certified
rank3 - Instructor
rank4 - Master Instructor
rank5 - Supervisor
I want to have a layout where 3 fields need to be shown:
1) First field - Drop-down list which shows only employees with rank1
2) Second field - Drop-down list which shows only employees with either rank3 or rank4
3) Third field - Drop-down list which shows only employees with rank5
I don't know how to make each field conditional using the above conditions
I have set up 3 tables:
rank: _pkRankID, RankName
employee: _pkEmpID, EmpFname, EmpLname, _fkRankID
trackingform: _pkFormID, FormDate FormComments, FormRating, _fkEmpID
I am getting very frustrated trying to figure out what fields to use and how to set up a conditional statement. I either get a ? or a 0 (zero) or nothing in my Drop-down box.
Could someone walk me through step-by-step how to do this please?
Based on your description, I put together a sample file that accomplishes this.
It involves:
Creating several global fields, corresponding to the appropriate rank ID
Create several Table Occurrences on the Relationship Graph, with relationships based on the global fields
Create several value lists, which pull from the Table Occurrences you created
You can download the sample file at http://cris.lc/pcuf4
I am implemeting Lucene for an ecommerce system and need to index the products along with their attributes. However, I'm not sure how to approach this as every product will have a totally unique attribute list.
Most examples online show a lucene access layer with a product structure such as Name / Title / Description, sometimes even with a custom field which just gets added for every product.
An example of two products that would need to be indexed are shown below. As you can see in this case (although not always) there are similar attributes, but also unique ones.
ID - 1
Product - Electric Shower
Name - Triton t80Z
Description - Details about shower here...
Attributes
Color - Black
Power Rating - 7.5Kw
Temperature Control - Manual
Water Entry - Top Left
ID - 2
Product - Digital Shower
Name - Grohe Grotherm
Description - Details about shower here...
Attributes
Color - Chrome
Temperature Control - Thermostatic
Water Entry - Top Left
Flow Limit - 8 Litre/min
LCD Display - True
Control Panel - Wireless
Control Panel Range - 10m
Given this situation, how would I index the above products and create a query in lucence to find any products across the site that contain a Temperature Control attribute which is Thermostatic?
Unlike with databases, Lucene has no schema (at least in the classical DB sense) so you are free to add any attributes (they're called fields) at any given time. Just create a new Field, with the relevant name/value, add it to the Document and that's it.
Q> how would I <..> create a query in lucence to find any products across the site that contain a Temperature Control attribute which is Thermostatic?
A> something along the lines of the following should just work, providing you will use the same analyzer which is used for indexing the document:
Query q = new AnalyzingQueryParser(<params>).parse("temperature_control:Thermostatic");
Going deeper into details, it depends if values for Temperature Control come from a pre-defined list, and how you want them to be searchable (exact match VS separate words, etc.). These will define settings for your analyzer.
My CMS is currently Movable Type 5.04. The attached screenshot is how I check in Compose Screen of MT CMS.
And it appears in the new entry create page with the following order.
- Location 5
- Job Description 5
- Bio 5
- Job Title 5
I would like to change the order into following.
- Job Title 5
- Location 5
- Job Description 5
- Bio 5
Is there any way to do so? I have checked in the cfg_entry.tmpl file and the above Entry fields were not there as there were custom fields. Could you please help me sort them like above?
the order of the fields are stored into the permission table, in 'permission_entry_prefs' field. (and there is a matching field for the page)
the row with blog_id 0 is the user defaults, and each blog's raw will override the default for this blog.
and the format is very simple: comma delimited list. you should find there something like "title,text,tags,assets". just reorder them for your liking.
If the user will toggle on and off fields, I'm not sure if the original order will return or not. if it does, then a simple plugin can solve it in more permanent way.
I remember doing this by recreating the custom fields in the wanted order (MT pulls them from the DB in a specific order, sorted by ID IIRC). If you have existing data, then you need to delete the fields definitions (not the data) then recreate them in the order you want changing just their numerical ID (not anything else).
I'm traveling and busy at the moment so can't dig into details. But study how CF are defined in the DB and how to simply reorder them by ID.