Telerik Forums
Kendo UI for jQuery Forum
1 answer
175 views
I have a pre-existing webforms .NET project that would benefit from KendoUI mobile for some dedicated mobile functionality.  I can get it functioning - and primarily utilize client side functions - but on the rare occasion when I need to use a server control - I'm encountering odd errors.

If I place a server control (like a link button) in a Kendo UI Mobile widget - I get an error when trying to postback.

<ul data-role="listview">
 <li><asp:LinkButton runat="server" ID="l" CommandName="db" CommandArgument='1' Text='Test'></asp:LinkButton></li>
 <li><asp:LinkButton runat="server" ID="l" CommandName="db" CommandArgument='1' Text='Test'></asp:LinkButton></li>
 <li><asp:LinkButton runat="server" ID="l" CommandName="db" CommandArgument='1' Text='Test'></asp:LinkButton></li>
 </ul>

It renders fine - a scrollable view of active list items - but any click/touch results in as js error:
Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: __doPostBack

Any way to work around this?
Bill O'Neil
Top achievements
Rank 1
 answered on 05 Dec 2013
2 answers
2.8K+ views
Hi Team, 

I am using Kendo UI file upload control with multiple attribute set to true.

Does File Upload control handles the failed uploads on its own ?

I am using the following code snippet on the server and i am posting data through web api.

[HttpPost]
        public Task Post()
        {
            var folderName = "Uploads";
            //var PATH = HttpContext.Current.Server.MapPath("~/" + folderName);
            var PATH = "C://Uploads/";
            var rootUrl = Request.RequestUri.AbsoluteUri.Replace(Request.RequestUri.AbsolutePath, String.Empty);
            if (Request.Content.IsMimeMultipartContent())
            {
                var streamProvider = new MultipartFormDataStreamProvider(PATH);
                var task = Request.Content.ReadAsMultipartAsync(streamProvider).ContinueWith(t =>
                {
                    if (t.IsFaulted || t.IsCanceled)
                    {
                        throw new HttpResponseException(HttpStatusCode.InternalServerError);
                    }                    
                });
                return task;
            }
            else
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotAcceptable, "This request is not properly formatted"));
            }
        }

 I want to capture the error information for the failed files and display that information to the user.

Kendo file upload is just returning the status as Failed for the failed uploads but how we can pass the actual error information back to the user?

Thanks
Zachary
Top achievements
Rank 1
 answered on 04 Dec 2013
2 answers
82 views
Hi!

I'm implementing a function that will be used as callback for several routes in my SPA. My challenge now is that I don't know how to get the route definition inside the function. For example:

var callback = function(){
   ///How to get the according route definition? For instance: "/login", "/main", "/items/:category/:id"
}

router.route("/login", callback);
router.route("/main", callback);
router.route("/items/:category/:id", callback);

Does the Kendo API provide a way to get that information?

Thanks.
Olivier
Top achievements
Rank 1
 answered on 04 Dec 2013
4 answers
1.3K+ views
How can I customize business hours range? and how can I hide that option ?
Sreekar
Top achievements
Rank 1
 answered on 04 Dec 2013
4 answers
122 views
I have two modals. One modal opens on top of the other. If I click anywhere on the screen after the second modal opens, the first modal closes. This is very undesirable. Does anyone know a workaround?
Michael
Top achievements
Rank 1
 answered on 04 Dec 2013
3 answers
708 views
Using Razor syntax with the Grid Data Source, I am trying to specify a valid URL.

I see the documentation recommends the syntax of   

.Read(read => read.Action("Orders_Read", "Grid"))

I want to use a url for an API that I use in the app that looks like "/Orders_read/Grid/id/1/office/2"

Do you have any razor examples of passing in the URL instead of the Action/Controller?  

Alexander Popov
Telerik team
 answered on 04 Dec 2013
3 answers
196 views
If you have a View Model that has a property that is an array and you bind it via "kendo.bind", whenever you change any input bound to the array, it refreshes/rebinds the ENTIRE ARRAY.  Is this by design or a bug?  It is definitely a performance issue when you have a big array.  Below is a sample project I made to demonstrate.  If you type a character in any of the inputs, it will auto-tab to the next input.  However, due to performance issue, it takes a long time for it to do so.  I am logging the "get" event to the console, and you will see that after you type into one of the inputs, every property of every item in the array is gotten again; hence the horrible performance.

================================================================
@{
ViewBag.Title = "Test";
}

<div id="placeholder"></div>

<script type="text/x-kendo-template" id="template">
<table id="scorecard">
<caption>#= TeamName #</caption>
# for (var i = 0; i < Scores.length; i++) { #
<tr>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H1', i) #" value="#= Scores[i].H1 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H2', i) #" value="#= Scores[i].H2 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H3', i) #" value="#= Scores[i].H3 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H4', i) #" value="#= Scores[i].H4 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H5', i) #" value="#= Scores[i].H5 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H6', i) #" value="#= Scores[i].H6 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H7', i) #" value="#= Scores[i].H7 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H8', i) #" value="#= Scores[i].H8 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H9', i) #" value="#= Scores[i].H9 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H10', i) #" value="#= Scores[i].H10 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H11', i) #" value="#= Scores[i].H11 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H12', i) #" value="#= Scores[i].H12 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H13', i) #" value="#= Scores[i].H13 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H14', i) #" value="#= Scores[i].H14 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H15', i) #" value="#= Scores[i].H15 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H16', i) #" value="#= Scores[i].H16 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H17', i) #" value="#= Scores[i].H17 #" /></td>
<td><input data-bind="#= kendo.format('value: Scores[{0}].H18', i) #" value="#= Scores[i].H18 #" /></td>
</tr>
# } #
</table>
</script>

@section Scripts
{
<script>
$(function () {
var
score, template, placeholder,
randomScore = function () { return Math.floor((Math.random()*10)+1); },
model = { TeamName: 'John Doe', Scores: [] };

for (var i = 0; i < 500; i++) {
score = { Number: i };
for (var j = 1; j <= 18; j++)
score['H' + j] = randomScore();
model.Scores.push(score);
}

model = kendo.observable(model);
model
.bind('get', function (e) {
console.log('getting...' + e.field);
})
.bind('set', function (e) {
console.log('setting...' + e.field);
});

template = kendo.template($('#template').html());
placeholder = $('#placeholder');
placeholder.html(template(model));
kendo.bind(placeholder, model);

$('#scorecard')
.on('focus', 'input', function (e) {
setTimeout(function () {
$(e.target).select();
})
})
.on('input', 'input', function (e) {
var next = $(this).closest('td').next().find('input').focus();
if (!next.length)
$(this).closest('tr').next().find('input:first').focus();
});

});
</script>
}

@section Styles
{
<style>
#scorecard input { width: 2em; }
</style>
}

================================================================
Petur Subev
Telerik team
 answered on 04 Dec 2013
1 answer
254 views
Hi I have a kendo grid which works well in firefox and internet explorer. 2013.2.716 is the version of the kendo I am currently using . When I call the grid edit in  the popup mode the popup window does not appear in Chrome. The google chrome version is   31.0.1650.57 m. I am running a windows 8 64 bit machine.
The kendo Grid Code is as below

 @(Html.Kendo().Grid<MyAssembly>()
     .Name("ListGrid")
      .DataSource(dataSource => dataSource // Configure the grid data source
          .Ajax() // Specify that ajax binding is used
          .Read(read => read.Action("Method1", "ControllerName").Type(HttpVerbs.Post))
          .Update(update => update.Action("Method2", "ControllerName"))  // Action invoked when the user saves an updated data item
          .Destroy( delete => delete.Action("Method3" ,"ControllerName"))
                  .Model(model =>
                  {
                      model.Id(item => item.ID);  
                      model.Field(item => item.ID).Editable(false);  
                  })
       )
      .Columns(columns =>
      {
          columns.Bound(o => o.ID)
                    .HeaderTemplate(@<text>
                      <input type="checkbox" title="check all records" id="checkAllRecords" onclick = "checkAssemblyRows()"/> </text>)
                    .ClientTemplate("<input type='checkbox' title='check record'  name='checkedRecords' onclick= 'checkRecords(this)' value='#=ID#' />")
                    .Sortable(false)
                    .Width("2%");
            columns.Bound(o => o.No).Width("15%");
            columns.Bound(o => o.ShortDesc).Width("15%");
            
            columns.Command(commands =>
            {
               // commands.Edit();
                    
                 
                //commands.Destroy(); // The "destroy" command removes data items
                
            }).Title("Commands").Width(200);
      })
      .Events(e => e.Edit("AssemblyListGrid_OnEdit_Kendo")
              
              )
        .Filterable()
        .Sortable()
        .Pageable(p => p.Refresh(true))
        .Scrollable()
        .ColumnMenu(col => col.Sortable(false))
        .Groupable()
        .Resizable(resize => resize.Columns(true))
        .Reorderable(reorder => reorder.Columns(true))
        .Editable(edit => edit.Mode(Kendo.Mvc.UI.GridEditMode.PopUp).DisplayDeleteConfirmation(false))   
      
      
      )

I have attached the error screen shot and the screen shot I took while I do the inspect element in chrome. It looks like it is working partly and the modal edit window fails to display.
Works perfectly in firefox and IE.
 This project has both the telerik and kendo controls.
Thanks
Vladimir Iliev
Telerik team
 answered on 04 Dec 2013
1 answer
201 views
<div data-role="window" data-append-to="#my-form" data-modal="true" data-visible="false" data-width="100%"></div>
The above code will not append the window to the my-form element. This can be fixed in the source by setting a default value for the appendTo option of the window, or in the user's own code using the below line (be sure to set this before binding your model):
kendo.ui.Window.fn.options.appendTo = null;
This was tested in v2013.3.1119
Kiril Nikolov
Telerik team
 answered on 04 Dec 2013
4 answers
178 views
how do i listen to a  selected date when pre-selected
ramesh
Top achievements
Rank 1
 answered on 04 Dec 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?