This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How to create a generic MVC3 editor template?
I am using editorfor as my input control and this is going out of my form when the screen resolution is low. I need to reduce the width of the control to fix this problem. I am trying to write an editor template for this but i am not figure out how. Please help me here.
Try looking at this link. They seemed to be able to manipulate the EditorFor field by wrapping it in a div and then using CSS to manipulate the div.
Related
I have a KendoUI Grid that holds records. One of the values in a record is a boolean that I am using to show/hide a command (delete). I was trying to follow the instructions here:
http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.command.visible
I then realized, if you click on the "Preview" it doesn't even work for them. I know I can use a template to set the class of the div tag and then hide it with some jQuery, but would rather do it with their built in feature...if it even work. Has anyone had any luck with the command visible command?
The link is working as expected now. I am also pasting a Dojo just in case:
Example
I have two questions regarding CKEditor Widgets:
First of all - I want to make it so when I highlight text and then click the widget's toolbar button, the highlighted contents are inserted into one of the widget's editable areas. How do I do that?
Secondly, I need to be able to nest my widgets - so in one of the widget's editable areas, I need to be able to add more instances of the widget. Currently, when inside my widget, the button for my widget is disabled. I tried adding allowedContent: true in the definition, but that doesn't seem to work.
Thanks in advance.
Regarding the second question – support for nesting widget is introduced in CKEditor 4.5.0 which will be released next week. See 4.5.0 Beta blog post. Before CKEditor 4.5.0 there's no support for nesting widgets, hence the button is disabled.
Regarding the first question – it is not a correctly formulated for StackOverflow. You should provide more details and some code that you already have. Read more in https://stackoverflow.com/help/how-to-ask. What's more, you should ask one question at a time, so please split them.
I would kindly ask for your help :) From couple of days I am trying to achieve "linked" custom field in content editor and dropdown in page editor.
Basically I want to have dropdown in page editor and content editor which are responsible for a same thing.
In my c# code i have enums which represent directions. I created custom field which accepts assembly and class with overridden onload method and successfully populate dropdown values in the content editor. So far so good but i have no idea how to create dropdown which will represent the same functionality inside page editor.
So please give me any ideas...
Judging from your reply to my comment you need to think of the following: How is my field value being rendered onto a page?
If you are always using 1 control to do this then you just need to ensure that this control has 2 different rendering modes depending on the Context.PageMode
But as I understand it you want this dropdown to also appear when someone renders your custom field using a <sc:FieldRenderer>. In this case you'll need to look into the RenderField pipeline of Sitecore. There you find a processor called RenderWebEditing. Possibly through some manipulation here you can get your dropdown appear as you wish.
I'm new to django, and I'm working on a quiz project. The idea is to create something similar to this (http://www.stylemint.com/quiz). Basically, there will be a question on each page and the user clicks on an image with the answer. I was planning on using a django form with a radio select input type, however, I'd like the image to act as the radio button (ie, be clickable) and also a click on the image will take you to the next question (instead of having to click submit after each). Is this possible with django, or do I need java?
it's perfectly possible - if you just want a series of images, and clicking on them to take you to the next question you might achieve that by:
Having multiple input fields of type "image" which all submit the form. If you go down that route you'll have to template the forms out yourself or make your own widget.
Using javascript to replace radio buttons with images dynamically. If you do that, it'd be a good idea to make it fall back to a straight list selection for people who don't have javascript.
Ignoring forms altogether and just using a view with a parameter of what the choice is.
Yes, it's completely possible. My suggestion is if you want to save the result in the db use model and model form in django. So, my next suggestion is you can customize model field for combine radio button functionality and image together. But actually you must programming and use a little jquery and javascript to do it.
You may want to see:
https://docs.djangoproject.com/en/dev/topics/forms/modelforms/
https://docs.djangoproject.com/en/dev/howto/custom-model-fields/
So my question is about handling both editing and viewing document data in same view. Basically, I have a view that can view document data. It has necessary fields and can show text information for user. How can I, guys, edit this document using this one view?
So seems like I need to pass some flag that indicates "editing" or "viewing" mode and show edit textboxes or just text.
Any techniques, methods to achieve this? Could you, guys, advice me something? Any blog posts, articles, manuals will be very appreciated.
Thanks in advance guys!
P.S.: it is ASP .NET MVC3 application (with Razor view engine).
I usually accomplish this using two differant actions (details and edit). You would decorate your actions using AcceptVerbs. POST vs. GET in this case. You can create a single 'partial view' that is returned by both actions. Its behavior (readonly / editable) will be dictated by the action that returns the view.
There is a very straight forward tutorial covering just this here:
CRUD
Reusing Views (Partial View)