Ember.js when use action want to render page current tap as well as new tap - ember.js

Edit, I am calling function edit and pass the id and get the details then render the edit page in same tab.Now, my problem was I unable to open in new tap when I try to open in new tab using clrl+click is not open. I want to open edit page current tab as well as new tap also..

If you want ctrl+click to open link in a new tab then the link needs to have an href set. This will happen automattically if you use the {{linkTo}} handlebars helper instead of {{action}}. If for some reason you need to use action instead then you will also need to manually bindAttr so that the href attribute is set. Have a look at the source for the linkTo tag to see how that can be done: https://github.com/emberjs/ember.js/blob/v1.0.0-rc.7/packages/ember-routing/lib/helpers/link_to.js#L323

Related

Open a modal from anchor tag but the content is from another page

Is it possible to open a modal from anchor tag but the content is from another page? If yes, can anyone help me on how to do this? Btw I'm using Odoo, there is a default add to cart page in Odoo, so all code there was already default and I can't just get the content of the specific part from add to cart page and load it in my modal which is another page.
You need to write a JS function to achieve this. When clicking on a button, you can listen to button click and show your modal accordingly. Odoo uses jQuery by default so you can call something like this.
$(".button-class").click(function() {
// do some stuff here
// either do jsonRPC to get data from another record.
// add values to the body
// finally show your modal
$(".modal-class").modal("show");
}

How to add a Custom Strip with a Custom Chunk and Button in Sitecore 8.1

As per subject - I want to create a custom button in a new Strip; the instructions that used to work for Sitecore 7.5 (adding a Strip Item under /sitecore/content/Applications/Content Editor/Ribbons/Strips, etc.) don't seem to work anymore in 8.1.
Can anyone link detailed documentation to do so?
First, right-click on the toolbar and see if you have the new menu listed as shown in the screenshot below. If not please see the following steps:
Navigate to /sitecore/content/Applications/Content Editor/Ribbons/Chunksand create a new Chunk. The template is at /sitecore/templates/System/Ribbon/Chunk
Create your button in the newly created Chunk which is based on the template /sitecore/templates/System/Ribbon/Large Button
Navigate to /sitecore/content/Applications/Content Editor/Ribbons/Strips and create your new Strip from the template /sitecore/templates/System/Ribbon/Strip
Then, add a reference for your Chunk using the template /sitecore/templates/System/Reference and in the droptree, select your created Chunk
Navigate to /sitecore/content/Applications/Content Editor/Ribbons/Ribbons/Default and create a reference using the template /sitecore/templates/System/Reference and select your strip from the droptree.
Refresh the page and see if it is present. If not, right click on the toolbar and see if you have your new navigation list as shown below:

How to make a statically binded rendering editable via Experience Editor (Sitecore MVC)

So I have a layout view within Sitecore Mvc, this view contained a Controller Rendering that pulls in a header and footer navigation. Example:
#Html.Sitecore().Rendering("/sitecore/layout/renderings/some_rendering")
This specifies a Controller Rendering I've defined in Sitecore. This works great, except when I'm in the experience editor. It doesn't give me the ability to select this rendering. If I create a Placeholder and then define these navigation elements to this placeholder dynamically via Sitecore, then I can, but these navigational elements exist on every page of this layout, so I would like them statically placed instead of using a Placeholder, but I would still like the user to be able to select the navigation element in the experience editor (so I can create custom command to interact with this navigation, such as creating new links, etc).
Does anyone have an idea that will help me achieve this?
Use Edit Frame for that and create Custom Edit Frame Button for operations like adding new element to the navigation.
And remember to pass Datarsource ID or Path as a second parameter to the Html.Sitecore().Rendering() method:
#Html.Sitecore().Rendering("/sitecore/layout/renderings/some_rendering", new { DataSource = "{some-id-or-path}" })
Here is set of blog posts which can help you to understand how Edit Frames work and how to add them in Sitecore MVC solution:
https://visionsincode.wordpress.com/2015/01/08/how-to-use-editframe-in-sitecore-mvc/
https://www.cmsbestpractices.com/how-to-properly-use-sitecore-edit-frames/
https://briancaos.wordpress.com/2011/11/28/using-sitecore-editframe-in-pageedit/
You won't be able to remove the component or move it around the page (yeah, it's statically bound to one place on your layout), but you will be able to edit it's properties and datasource.
You can try to use GlassMapper views and statically inherit the view from the GlassView.
Then you'll be able to use Editable method to render the field.
But the consideration you need to take is that you'll not be able to set a datasource to the component from the page editor or content editor.
Instead of injecting the rendering through the Rendering method you should be able to use standart MVC RenderPartial.
I've used this approach on one of the projects I've been on and it worked.

Ember.js Multiple Selection on Click -- Dropdown Menu

New to ember but trying to figure out how to allow selections on click. Once selected, I want to have the ability to select 'Remove' from the actions dropdown to remove the images from the store. Is this possible or do I have to revert to a checkbox somewhere?
Gist Here
JSBin Here
Try this out: http://jsbin.com/pezikuji/2/
What I've basically done in this update was bind a property called "isSelected" from your model to your view.
I'm then using that property in ImagesController to create a computed property called canDelete. This is used by the template in an if statement to show/hide a menu item.
Hope that helps!

save disabled on sitecore page editor

I'm been working with Sitecore for a while, but this is my first time on the page editor.
So, I go to my sublayout and I place a sitecore tag instead a .net tag
<sc:Text ID="txtContent" Field="Content" runat="server"/>
Content is the normal content field on the sitecore page.
When I go to the page editor, I'm able to see the correct content and do some editing but the save button is disabled and my changes are not saved at all
I'm I missing something very basic here?
this is a screen cast on what I'm doing
http://screencast.com/t/0itqgjGVQx8
Update: After including jquery.noconflict constructs, the execution moves to the handler function in the ribbon correctly. BUT it seems that the button itself is disabled. Is it possible to enable/disable the button? is it disable on specific situations? if so how can I enable it.
There might be invalid html appearing. Check you hints for buttons, etc. There might be non-escaped texts on the page.
I've resolve this some time ago... in the sublayout definition on sitecore there was a redundant/wrong compatible rendering definition. Once I removed that, the save button appeared and the sublayout started to work as expected