i am newbie to Ext Js..i am working on ruby on rails...
can any1 suggest a good basic tutorial for "multiline grid" pllzz...
I guess for that you will have to return prepared data on the server and then add some css to it.
If you have one column then your data might look something like this:
<div> id and name </div>
<div> desc and pic </div>
Then add css for grid cells:
.x-grid3-cell-inner div { .... }
Would help if you posted an example.
Try this:
extjs-multi-line-grid-headers-and-cells
ext-js-grid-with-multiline-rows
Related
I'm setting up Umbraco 7.7 for the first time and creating the document types and templates for a page that displays the people that work at our organization (includes their names, photos, and bios).
How do I configure it such that the content manager can add another "person"—effectively a cluster of divs with user-editable images and text—without having to manually add another "person" to the template? Using Partial Views seems like part of the solution, but I'm unclear on how to fit it all together.
My template (simplified) currently looks something to the effect of:
#inherits Umbraco.Web.Mvc.UmbracoTemplatePage
#{
Layout = null;
}
<!doctype html>
<html>
<body>
<div class="person-bio">
<img src="/media/person-01-photo.jpg">
<p>#Umbraco.Field("person-01-name")</p>
<p>#Umbraco.Field("person-01-title")</p>
<p>#Umbraco.Field("person-01-bio")</p>
</div>
<div class="person-bio">
<img src="/media/person-02-photo.jpg">
<p>#Umbraco.Field("person-02-name")</p>
<p>#Umbraco.Field("person-02-title")</p>
<p>#Umbraco.Field("person-02-bio")</p>
</div>
<div class="person-bio">
<img src="/media/person-03-photo.jpg">
<p>#Umbraco.Field("person-03-name")</p>
<p>#Umbraco.Field("person-03-title")</p>
<p>#Umbraco.Field("person-03-bio")</p>
</div>
<!-- etc., etc. -->
</body>
</html>
Thank you! Any help would be much appreciated.
You'll probably will want to use the Nested Content control for this. It allows you to add a list of entities (in your case persons) on a document
More documentation about the nested content control can be found here: https://our.umbraco.com/documentation/getting-started/backoffice/Property-Editors/Built-in-Property-Editors/Nested-Content
So from my understanding you don't need a partial view. If it's that simple and you want to output only the div I see you're repeating, then loop it:
#foreach (var person in whateverYourCollectionIs) {
<div class="person-bio">
<img src="/media/person-01-photo.jpg">
<p>#person.GetPropertyValue<string>("pseudoNameFieldAlias")</p>
<p>#person.GetPropertyValue<string>("pseudoTitleFieldAlias")</p>
<p>#person.GetPropertyValue<string>("pseudoBioFieldAlias")</p>
</div>
}
That loop will create the exact same html for each person, but with the appropriate names, Titles, Bio etc. This is not the actual code you get to use but it hopefully leads you to the correct direction.
This is the documentation that will help
In facebook format references https://developers.facebook.com/docs/instant-articles/reference nothing is mentioned about adding tables. When I try to add tables inside tags that is getting truncated by facebook. Is there anyone resolved this issue?
Thanks in advance for the help.
Tables are not supported out of the box. You can wrap them in an op-interactive though. They won't inherit any styling so you might need to add some styling as well.
<figure class="op-interactive">
<iframe>
<table>
[...]
</table>
</iframe>
</figure>
I'm trying to create a partial view macro that list all items (blog entries). I can read its name, but not the entry field like it's content:
#foreach (var page in CurrentPage.Children.Where("Visible").OrderBy("CreateDate desc"))
{
<div class="article">
<div class="articletitle">#page.Name</div>
<div class="articlepreview">
#Umbraco.Truncate(#page.Field("pageContent"),100)
Read More..
</div>
</div>
<hr/>
}
All pages are defined as a ContentPage (document type) where I've added Page Content (pageContent), type: Richtext editor as a Tab: Content element.
Do I need to cast the page or something to Contentpage?
What Im trying to do Is to give a 100 char long preview of the content on my main page so the users can read a short excerpt before clicking on the item.
Technically they are Properties of a doctype, not Fields.
So I believe this is what you are looking for:
#page.GetProperty("pageContent").Value
And truncate...
#Library.Truncate(#page.GetProperty("pageContent").Value,100)
However in this context you should be able to simply use…
#page.pageContent
So...
#Library.Truncate(#page.pageContent,100)
…should work!
I think this will give you the text you are looking for (I think your problem was just that extra #):
#Umbraco.Truncate(page.Field("pageContent"),100)
If you are running on umbraco 7+, try this:
#Umbraco.Truncate(page.AsDynamic().pageContent, 100)
Hope this helps!
I have a Document Type, that has a tab with some properties.
The properties are Upload types, and Simple Editor types.
(Users are supposed to upload images with some image text).
I have not grouped the "Upload" and "Simple Editor" properties, so how do i do this?
Next question,
I want to loop through each group (there should be 3 currently) and display them on my website.
The markup should look like the following:
<div>
<img src="PATH-TO-UPLOAD-TYPE" />
<div>"TEXT FROM SIMPLE EDTIOR TYPE"</div>
</div>
..
<div>
<img src="PATH-TO-UPLOAD-TYPE" />
<div>"TEXT FROM SIMPLE EDTIOR TYPE"</div>
</div>
...
I would like to use Razor for this. Thanks in advance!
For the first part, using the Razor model, you can't. The content object that you get on the front end only contains the properties, the tabs are not included, as they're only really for organising things in the back office.
You CAN get that information using the Umbraco API, but it's pretty database intensive and could potentially be quite slow if you have a lot of properties/tabs.
You'd be better grouping them yourself in your Razor Macro.
for the second part, you can acces the properties of a page via #Model.property. For example:
<div>
<div>#Model.simpleProperty</div>
</div>
I have made a form which embedded forms to add new records in a one-to-many relationship with ajax, my question is, where do I edit the template for the embedded form? because I would assume this would be in _form.php but it doesn't seem to use that template
Thanks in advance
If your are adding fields by ajax you can do the response of the ajax with some template. For example if you have a mail field you could do:
public function executeAddMailForm($request)
{
$this->forward404unless($request->isXmlHttpRequest());
$mail = new MailForm();
//action logic...
return $this->renderPartial('addMail',array('form' => $form));
}
and make a _addMail template:
<div class="form-ajax-item">
<div class="form-ajax-label">
<?=$form['mail']->renderLabel()?>
</div>
<div class="form-ajax-field">
<?=$form['mail']->render()?>
</div>
</div>
This way you can do the ajax response using templates.
In fact it does come from the same _form partial as the main form. Form elements in symfony by default render as a table row, so this might be what is causing your confusion. Could you please tell us what you're wanting to do.
There is documentation on how to do this and a very detailed example on the symfony website see here. It's pretty in depth and can look a bit daunting but I recommend you read through it and make sure you take the time to actually understand it.