Is there a way to group items in multiselect combobox of Telerik Kendo UI.
I have found templates only to customize the items look and feel.
Can I group the items?
Even though it's quite old, but still missing answer and someone (with poor googling skills) might need an answer.
Grouping is controlled by a dataSource property group:
dataSource: {
/*other configuration*/
group:
{
field: "modelPropertyName"
},
}
where model property, you want to group by, needs too be specified.
Kendo api and example
Related
Question that covers both the Experience (Page) Editor and the Content Editor.
I have a Timeline spotlight that users can add to a page - it has a list of decades at the top and underneath each decade there is a list of Years (with their text and images).
I have created a number of controls that link to various data sources but I'm finding the user experience lacking.
If I go to the Experience Editor:
Select Timeline Placeholder and Add Item
Popup comes up to select/create the data source
Then the only way to add a decade is by going to the Decade datasource, creating a new item there and then going back to the Timeline data source and adding this item their.
What I'm thinking of is:
Content Editor - Against the Timeline data item their is a multi-list field of 'Decades' - is there any easy way to add a 'Create' button next to it that would replicate the same event as if you went to the Decades data source and clicked insert item
Experience Editor - Remove the use of the Placeholder and add a similar 'Create' button that will replicate the insert item event - once item created and properties set refresh the control to display according.
Anyone came across something similar before? Any better solutions?
Thanks,
Dan
I'm actually working on the same features for our new implementation.
In Content editor, you might need to update core db.
In xEditor, you can use sitecore JS commands with ajax and back-end codes. My suggestion is that you can create a rendering component and assign the component into the named placeholder instead of remvoing it. Then, call the back-end and javascript events on the rendering item.
This could be a starting point.
Javascript
function:
function setDataSrc(itemID, templatePath, suffix, renderingID, dbName, deviceID, renderingUID, reload, callBack) {
var postReq = $.post("/handlePostRequest.aspx (or .cshtml)", {
method: 'methodName'
, itemID: itemID
, templatePath: templatePath
, suffix: suffix
, renderingID: renderingID
, dbName: dbName
, deviceID: deviceID
, renderingUID: renderingUID
});
postReq.done(function (data) {
if (reload != false) {
location.reload(true);
}
if (typeof callBack == 'function') {
callBack(data);
}
});
}
Got an answer from the Sitecore Community that might be helpful -
In experience editor you can create an edit frame button and use it for your rendering... from what i can see, your rendering data source points at "decades" folder. inside your rendering, check if you are in page editor and use a custom edit frame to display custom buttons. one of those will be an insert button to allow you to create a new child under "decades".
Full details in this blog post re Experience Editor Edit Frame Button.
I'm using sharepoint 2013 and i want to utilize the client side rendering feature using JSLink, when editing the web part for the calendar new event, in the "miscellaneous" there is no field for JSLink, how to modify the render for new event using JSLink ?.
It is not possible. See this discussion.
After about an hour's worth of research I found the problem. Microsoft specifically targets the Invalid, Event, and Survey list types to ignore client rendering. Unless you create your own webpart you will not ever be able to use any of the JSLink properties for these list types. Maybe somebody at Microsoft can explain themselves here as to why they would have crippled us like that or what a proper approach for this common problem would be. Yet another reason the Calendar is a piece of garbage in SharePoint 2013!
Also this answer:
There is no OOTB way to attach Javascript with calendar view (no property exposed for that listview). For a workaround you can create your own JQUERY or JAVASCRIPT and add on calendar view page by adding the reference in Content Editor Webpart on that page.,
However I have a quick but dirty solution. Add a SriptEditor to yout page, below the calendar and insert:
var oldEditLink = EditLink2;
EditLink2 = function(a,b,c){
if (isNaN(b) && b.substring(0,3) == "WPQ"){
var itemId = a.getAttribute("href").split("=")[1];
// do what you want to do
return false;
}
oldEditLink(a,b,c);
}
So I am rather new to sitecore, and it's a topic that wasn't covered during my training. My questions is just to help point me to the correct term, or documentation on a method to do the following.
I have a definition item, with a ton of field groups, what I want to do is something like:
if Value of Field X is "yes" then collapse/hide Field X or Field Group X.
Does that make sense? Is it a validation rule? or some other kind of rules, is it a workflow I need to attach? Do you place it on just the field I want to hide, or the field that triggers the action?
I appreciate any guidance.
There is nothing out-of-the-box in Sitecore to achieve what you want but there is no reason you cannot create a composite custom field type to do this. The following articles will help you achieve this:
Creating a custom Sitecore Field
Getting to Know Sitecore: Custom Fields, Part 1
Create a new control, inheriting either from Droplist (if the comparison of the value is to be text based) or Droplink (for comparison of ID). You could add a parameter in the Source field of the control to specify what the values that trigger the hide should be.
The underlying control in the Content Editor is just a standard HTML select element. Add onchange events to the control and add your Javascript handler to hide the other controls. Since I could not find a way of adding additional custom css classes to the Sitecore controls, it would be best/easiest to hide all other controls in the same collapsible group after you control. This would mean you would need to group your controls better (or logically at least).
The Javascript will be something like this (the Content Editor uses the Prototype JS framework):
if ($(this).getValue() == 'no') {
// find the parent container of this control and then hide all the next siblings in the same group
$(this).up('.scEditorFieldMarker').nextSiblings('.scEditorFieldMarker').invoke('hide');
}
You can test this by running the above in the console, change out the keyword this with the id of your field, e.g. $('FIELD2292054').
What I am not sure about is how to trigger the hide on initial load, i.e. when someone returns to an existing item, it may be possible by adding to one of the pipelines, but would be better using a JS solution if possible. I'll have a think about this and get a proper code sample up over the next few days.
EDIT: You can add an event handler to sc:contenteditorupdated to handle the content editor being rel-oaded.
document.observe("sc:contenteditorupdated", myFunction);
I wrote up a blog post and put the code on GitHub if you are interested.
Not sure if you have come across Andy Uzick's this blog post.
He wisely talks about hiding fields in the Content Editor and has also created a Sitecore Module called Hide Field Template Extension which is hosted on the Sitecore Marketplace with the full source code to extend.
After reading through and trying the extension, I do feel that it will not completely resolve your issue (how you have described it in the question).
But it will give you:
A mid-term solution to hide a few unnecessary field that some content editors would not like to view.
Fields that are only required by administrators for admin purpose - to de-clutter these fields could be hidden.
Just one thing to bear in mind that it mentions in the requirements Sitecore 6.5 & 6.6. I have not tested it in Sitecore 7. If you are using Sitecore 7, which I think you are, one could modify the source code and make it work for Sitecore 7.
Have a look and share your findings.
Happy Sitecoring!
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!
I am working with sitecore and now i needs to hide some of the content item in sitcore.what is the process to hide the content'
Why do you want to hide and what do you want to hide?
You could probably setup security to only allow people with certain roles to read, write, etc certain items (and subitems) or setup that only certain roles can see certain fields.
You can probably find most of what you need here:
http://sdn.sitecore.net/Reference/Sitecore%206/Security%20Administrator%20Cookbook.aspx
Otherwise give an example of what you want to do, it might be easier to help then.
If you want to hide from a role or a user, you can setup permissions accordingly to do so. Please specify the requirement.
Perhaps not exactly what you need, but it's not really clear. You can hide items from regular (= non-admin) users by setting the checkbox Hidden as such, which can be found in the Appearance section of your item. When hidden, your items will be displayed in grey and italic in the item tree for administrators, and totally non-visible to users. Note that if you cannot find the section, you need to enable the Standard Fields under View in the ribbon.
Of course this field is also accessible via the API by any of these two means:
item.Appearance.Hidden = true; // Or false.
item[Sitecore.FieldIDs.Hidden] = "1"; // Or string.Empty.
Hide items from non admin users by using 'Hide Item' button in configure ribbon.
Protect items from non admin users by using 'Protect Item' button in configure ribbon.