Maybe I'm misunderstanding something (quite possible as I'm new to Backbone), but I can't find a list of the built-in events that I can bind to. Can anyone point me in the right direction?
It's listed in the backbone documentation, located at the link below:
http://backbonejs.org/#Events-catalog
Related
I would like to add another property like categories in EpiServer. I am already using the categories for something, but I need the same type of functionality for something else. To be able to maintain a list of options in the CMS and give the Editor the possibility to attach them to a block / page. Can someone point me in the right direction.
Unless I'm misunderstanding your question, you could just add another property of type PropertyCategory: http://world.episerver.com/documentation/Class-library/?documentId=cms/9/A942B3E7
It will essentially give you another category selector, in addition to the built-in one.
I have a DevExpress DxGrid bound to an ObservableCollection of viewmodels (based on SimpleMvvmToolkit).
The viewmodel has 2 properties exposed by itself (a string and a boolean) and a few other properties are exposed by its base class (ViewModelDetailBase), one of them is the model behind the viewmodel.
Everytime I use the grid to modify the contents of one of the properties (e.g. the boolean value), I get an error saying "The type xxx cannot be serialized.." (xxx is the type of the Model) followed by the suggestion to use DataContractAttribute to circomvent the issue.
I am not sure how and where to look for a solution. Maybe I should read up on it, but why is serialization needed here??
Anyway, I hope you can shed a light on this. I'd appreciate some pointers to get me looking in the right direction.
edit: Since the situation is too intricate to post the relevant code here, I made a sandbox project that reproduces the error. You can find it via this WeTransfer link.
Best regards,
~Rob
Thanks to great help of the Simple MVVM Toolkit community I found out that the solution was simple.
In Simple MVVM Toolkit, A viewmodel needs to be serializable because it gets cloned. This is to easily roll-back data when an action is canceled. The reason my viewmodel could not be cloned whas because its "model" property was missing a default (parameter-less) constructor.
There's no need to decorate the viewmodel and its properties with [DataContract] or [DataMember].
I hope this helps others.
my question is:
"What is the right way to operate with XTemplates in a MVC like project in ExtJS4?"
> Are XTemplates supposed to be in YourApp.view or in YourApp.controller?
The ExtJS4 docs just shows how to use XTemplates with some data, but i haven't seen a MVC-like example.
So,
Where should our XTemplates take place at?
Can XTemplate take some variable from controller as argument? (in case i would get some calculated data in controller and every time those data changes they should be passed to XTemplate and this XTemplate should form and render new template to the webpage;
P.S.
Sorry for my English and Thanks for your help;
I'm not an expert, but i can share with you/SOF a few thoughts and hopefully help you out to understand more the templating engine of extjs.
In very general terms, the XTemplate is what a view/control(grid, texfield, etc) is built on. Every component control in extjs has a "Tpl" or "fieldSubTpl" or "subTpl" etc.. config options which is the XTemplate to use to render the component UI.
So, imagine you are using extjs native class "Ext.form.field.TextArea" which represents an input text control, if you look in the source code of extjs framework (I think people often forget about checking out the source code, learn and get inspired from it, get the grip on things, see how extjs dev. team does things) and locate the class definition for it, and you will be able to see how the XTemplate is used. So I think if you can check this out and understand it, ofc, sencha docs is a valuable resource, you get already some answers.
XTemplate takes an array with data/single object whose properties need to match the variable inside the XTemplate, so you got an object representing a person and a property name i.e. person.Name so in your xtemplate would would show the name by using {Name} inside the xtemplate. You mention about doing some calculation in the controller and then pass it into the XTemplate, that is fine you can do it, but remember that the XTemplate support custom functions which can manipulate the data before the Xtemplate is rendered as you can see in this example from sencha docs http://docs.sencha.com/ext-js/4-0/#!/api/Ext.XTemplate
If you want an MVC application which uses XTemplates explicitly, you can check the "MVC Feed viewer" app from sencha here http://docs.sencha.com/ext-js/4-0/#!/example/feed-viewer/feed-viewer.html
I hope it helps you.
Happy Easter!
I am designing a Winforms MDI application following MVP pattern, and I'm stuck on some problems related to communication between different part of my application.
Here a simple picture of this application:
1 -On the left a treeview
2- In the middle a drawing component
3- on the right, a "property" form.
These 3 parts are managed with a MVP triad ( well ,not really , Model is common to all triads)
When I click on a node on the treeview, I want to see a drawing of the corresponding selected object in the drawing component ,and I want to see some properties corresponding to this selected object in the property form.
My basic question are :
a) Where to store "Selected object " information ?
b) How to warn Drawing component and property form that "Selected object " has changed ?
I started to imagine some solutions but I am quite unhappy.
I don't buy putting "Selected object " in the Model and perform observer synchronization.
"Selected object " does not belong to the Model
SO I imagine, I would store this information in a presenter
If I put "Selected object " in Treeview presenter, it seems to me that both Presenter for drawing component and Presenter for Property form will have to hold a reference on treeview presenter, to retrieve this information.
It creates some coupling between presenters , and I don't like also.
So I am looking for other ideas, and or comments. thanks for your time.
First of all, sorry for a late response :) had lots of stuff to finish :D
I don't know how exactly your code is built but may be you could use Retlang. Then you could easily pass list of IDs in the message and handle this message wherever you like.
Also it would be quite interesting for me to hear how you managed to solve your problem a year ago.
I am new to Silverlight and have a requirement to highlight (or change font color) all words and phrases wtihin a TextBox that match a list of words/phrases. At first I though this would be easy, but the more I look into it, the more confused I get.
My goal is to write something reusable so I can also apply the logic to a RadGridView later. I've seen a few examples of stuff close to what I need, but it's beyond my Silverlight level at this point.
I want to write this myself to get a better understanding of how some of the Silverlight internals work. Can someone point me in the right direction of where to start on something like this? Should this be implemented in a control? Should I use a behavior? I'm using Silverlight 4.
Once I know where to start, I am sure I can get this done - with some help from you guys of course ;-)
Thanks,
-Scott
How about using the RadRichTextBox (I assume you have a licence for it as you mentionned the RadGridView)?
There's also a good sample project on Telerik forum that is doing exactly what you want to do.