Telerik Forums
Kendo UI for jQuery Forum
4 answers
144 views
It seems like the only way to define templates for controls declared with .Net syntax is to use escaped literal text. Whereas if the control is declared with javascript syntax, one can embed the template content in a named/ID'ed script tag and reference that ID. Is there any way to accomlish this with .Net syntax?
FAYE SCHAB
Top achievements
Rank 1
 answered on 26 Jun 2013
2 answers
102 views
The image EditKey1 was generated from the following code inside the Icenium Simulator. Note particular the three divs that are shown as content inside the "enterStatus" div. All three divs are seen in the image.
<div data-role="view" id="share" data-layout="default" class="share-view"
    data-init="app.viewModels.editYFKey.init" data-show="app.viewModels.editYFKey.show" data-model="app.viewModels.editYFKey">
    <header data-role="header">...</header>
    <div id="enterStatus" class="user-status-wrp" style="background-color: white; height:100%;" >
        <div class="user-share" style="width:100%;">
            <span id="YFKeyEdit_NameLabel" style="width: 98%; text-align: center;" ><b>Name:</b></span><br />
            <input id="YFKeyEdit_Name" placeholder="Enter a brief name for the key area here" style="width:99%;" required validationMessage="The name for this key must be given!" />
            <div id="newCommentValidation" class="validation">The name is required!</div>
        </div>
        <div class="user-share" style="width:100%;">
            <span id="YFKeyEdit_IntentionsLabel" style="width: 100%; text-align: center;" ><b>Intentions:</b></span>
            <a class="nav-button" data-align="right" data-role="button" onclick="AddIntention">Add</a>
            <span id="editYFKeyIntentions">
                <ul>
                        <li>test1</li>
                        <li>test2</li>
                        <li>test3</li>
                        <li>test4</li>
                </ul>
            </span>
        </div>
      <div class="user-share" style="width:100%;">
            <span id="YFKeyEdit_DescriptionLabel" style="width: 100%; text-align: center;" ><b>Description:</b></span><br />
            <span class="txtarea-wrp">
                <textarea id="YFKeyEdit_Description" rows="3" placeholder="Enter a description for the key area here" style="width:99%; resize: none;" required validationMessage="The name for this key must be given!" />
            </span>
            <div id="newCommentValidation" class="validation">The name is required!</div>
        </div>
    </div>
</div>


The image EditKey2 was generated from the following code inside the Icenium Simulator. Note that the ONLY difference is that the three divs are in a different order. NOTE THAT THE THIRD DIV JUST DISAPPEARS. Any idea what I am doing wrong, or what concept I'm missing? 
<div data-role="view" id="share" data-layout="default" class="share-view"
    data-init="app.viewModels.editYFKey.init" data-show="app.viewModels.editYFKey.show" data-model="app.viewModels.editYFKey">
    <header data-role="header">...</header>
    <div id="enterStatus" class="user-status-wrp" style="background-color: white; height:100%;" >
        <div class="user-share" style="width:100%;">
            <span id="YFKeyEdit_NameLabel" style="width: 98%; text-align: center;" ><b>Name:</b></span><br />
            <input id="YFKeyEdit_Name" placeholder="Enter a brief name for the key area here" style="width:99%;" required validationMessage="The name for this key must be given!" />
            <div id="newCommentValidation" class="validation">The name is required!</div>
        </div>
            <div class="user-share" style="width:100%;">
            <span id="YFKeyEdit_DescriptionLabel" style="width: 100%; text-align: center;" ><b>Description:</b></span><br />
            <span class="txtarea-wrp">
                <textarea id="YFKeyEdit_Description" rows="3" placeholder="Enter a description for the key area here" style="width:99%; resize: none;" required validationMessage="The name for this key must be given!" />
            </span>
            <div id="newCommentValidation" class="validation">The name is required!</div>
        </div>
        <div class="user-share" style="width:100%;">
            <span id="YFKeyEdit_IntentionsLabel" style="width: 100%; text-align: center;" ><b>Intentions:</b></span>
            <a class="nav-button" data-align="right" data-role="button" onclick="AddIntention">Add</a>
            <span id="editYFKeyIntentions">
                <ul>
                        <li>test1</li>
                        <li>test2</li>
                        <li>test3</li>
                        <li>test4</li>
                </ul>
            </span>
        </div>
    </div>
</div>
Thanks for your assistance!
CW
Chris
Top achievements
Rank 1
 answered on 26 Jun 2013
2 answers
76 views
I have the following (simplified) VMs;

public class ProjectModel
{
    public int ProjectId { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public List<CountryModel> Countries { get; set; }
}

public class CountryModel
{
    public int CountryId { get; set; }
    public string Name { get; set; }
}

I am using the Grid with ajax binding to display the list of projects. I have a custom UI for the user to specify search criteria, i.e. textboxes for name and description, and a MultiSelect control so that the user can select one or more countries.

I want custom filtering against the countries - I want the search to perform an AND filter returning Projects that are associated with all the countries selected by the user.

I am currently able to capture title, description and the selected countries from the MultiSelect, and pass them to my ProjectSearch Controller Action as additional data (using the DataSource Read Data). I then create  FilterDescriptors for the project name and description, but am a bit stuck as to how to do it for the countries. 

So what is the correct way of creating the FilterDescriptors for a country search? What "member" should I specify? What operator do I use?

Many thanks for any assistance.

Phil
Philip Street
Top achievements
Rank 1
 answered on 26 Jun 2013
0 answers
298 views
Hi,
We have used kendo grid in our Tablet app which is developed in html5 using winjs.
We need need to export the data in Kendo grid to ppt.Please help me regarding the same.
Rama
Top achievements
Rank 1
 asked on 26 Jun 2013
4 answers
87 views
Hi guys

Is there a way to attach the same init method (beforeShow and show too) to all Views, without specifying on html? Or maybe a way to bind to an event that gets triggered from all Views?

I think a good way to solve this would be the possibility to specify the View init method through the Layout. I have many Views with the same Layout, and all of them use the same init and show method. If we could put that in the Layout, the markup would become simpler and more maintainable.

Thanks!
Petyo
Telerik team
 answered on 26 Jun 2013
1 answer
943 views
I am amending the CSS files to tailor buttons and screens to suit our company layout and it will be necessary to resize the icons depending on the amount of data on the screen.  I have made some modifications which reduce the size of the text box and text, but I cannot successfully get the image icon to shrink.  I have managed to remove the icon to just display text, but ideally I would like the button to either display the icon and text if the the button is big enough but just text if the button is small.  At the moment when text only is displayed the text is off centre.  My code for the button and the icon is as follows:
.k-button.k-button.k-button-icontext {
    /*background-position: top;*/
    font-style: normal;
    font-family: Calibri;
    font-weight: normal;
    font-size: small;
    border-image-outset: 0px;
    /*height: 16px;*/ /*font-size-adjust: inherit;*/
    vertical-align: top;
    text-align: center;
    white-space: normal;
    /*overflow: auto;*/
    margin: 0px,0px,0px,0px;
    }

.k-icon {
    /*fit:slice;*/
    /*background-image:none;*/    
    display: inline-block;
    width:auto;
    height:auto;
    background-size:contain;
}
I also have another button which does not have an icon which needs to be the same size as these buttons which is why I need generic code to suit the row height.
As you can see I was experimenting with some other options - with the current settings the icon is not being displayed although I think there is enough room.  Any suggestions of amending the code gratefully received.
Dimo
Telerik team
 answered on 26 Jun 2013
8 answers
361 views
I would love to see infinite scrolling make it into the roadmap at some point.  This is essential UI, especially on mobile and the plugins that are out there haven't really nailed it down yet.

Just a thought...
Atanas Korchev
Telerik team
 answered on 26 Jun 2013
21 answers
1.0K+ views
Hello,
how to add custom icons for the tabstrip that work with the gradients?

i tried the recommended solution but the gradients aren't working. the default icons got svg masks but i guess they're is / has to be a way to add custom icons.
thanks in advance
Ralph
Top achievements
Rank 1
 answered on 26 Jun 2013
2 answers
28 views
I try to follwer the example in example,My grid have more than five hundreds row,when I slip the mouse to select the grid cell,the web brower crashed!My grid is grouped bug not allowed to page,it is a bug of grid? How to avoid this phenomenon? How to disable the mouse to slip to select the cell,Use shortcuts ctrl+Shift is OK!
vaeaze
Top achievements
Rank 1
 answered on 26 Jun 2013
1 answer
66 views
Hi, I'm try to use Kendo grid follow demos This --> http://demos.kendoui.com/web/grid/editing-popup.html

But Gird cann't Bind data 

Follow Controllers, and cshtml


public ActionResult Section()
       
{
           return View();
       }
 
       public ActionResult EditingPopup_Read([DataSourceRequest] DataSourceRequest request)
       {
           return Json(db.Sections.Where( s=>s.IsPublished == true).ToList().ToDataSourceResult(request));
       }
 
       [AcceptVerbs(HttpVerbs.Post)]
       public ActionResult EditingPopup_Create([DataSourceRequest] DataSourceRequest request, Section section)
       {
           if (section != null && ModelState.IsValid)
           {
               db.Sections.Add(section);
               db.SaveChanges();
           }
 
           return Json(new[] { section }.ToDataSourceResult(request, ModelState));
       }
 
       [AcceptVerbs(HttpVerbs.Post)]
       public ActionResult EditingPopup_Update([DataSourceRequest] DataSourceRequest request, Section section)
       {
           if (section != null && ModelState.IsValid)
           {
               var target = db.Sections.FirstOrDefault( s => s.SectionID == section.SectionID);
               if (target != null)
               {
                   target.Name = section.Name;
                   target.Description = section.Description;
 
                   db.Entry<Section>(section).State = System.Data.EntityState.Modified;
                   db.SaveChanges();
               }
           }
 
           return Json(ModelState.ToDataSourceResult());
       }
 
       [AcceptVerbs(HttpVerbs.Post)]
       public ActionResult EditingPopup_Destroy([DataSourceRequest] DataSourceRequest request, Section section)
       {
           if (section != null && ModelState.IsValid)
           {
               var target = db.Sections.FirstOrDefault(s => s.SectionID == section.SectionID);
               if (target != null)
               {
                   target.IsPublished = false;                 
 
                   db.Entry<Section>(section).State = System.Data.EntityState.Modified;
                   db.SaveChanges();
               }
           }
           return Json(ModelState.ToDataSourceResult());
       }
@(Html.Kendo().Grid<MVC4Kendo.Models.Section>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Name);
        columns.Bound(p => p.Description).Width(100);
        columns.Bound(p => p.IsPublished).Width(100);      
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .Pageable()
    .Sortable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.SectionID))
        .Create(update => update.Action("EditingPopup_Create", "Grid"))
        .Read(read => read.Action("EditingPopup_Read", "Grid"))
        .Update(update => update.Action("EditingPopup_Update", "Grid"))
        .Destroy(update => update.Action("EditingPopup_Destroy", "Grid"))
    )
)
<script type="text/javascript">
    function error_handler(e) {
        if (e.errors) {
            var message = "Errors:\n";
            $.each(e.errors, function (key, value) {
                if ('errors' in value) {
                    $.each(value.errors, function () {
                        message += this + "\n";
                    });
                }
            });
            alert(message);
        }
    }
</script>


Vladimir Iliev
Telerik team
 answered on 26 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?