Telerik Forums
Kendo UI for jQuery Forum
1 answer
74 views
I would like to make the datepicker readonly but still allow the user to select the date via the picker.

I've tried:

$("#datepicker").attr("disabled", "disabled");

This works on my PC but not on the iPad, on the iPad it appears to disable the picker as well.  In addition I don't want the visual style to change though I could probably figure out how to fix that.

I also tried:

$("#datepicker").attr("readonly", "readonly");

This one actually does exactly what I want when testing on a PC, but again on the iPad it appears to also disable the picker.  How do I get the behavior on the iPad to match so the picker is enabled but the user cannot input text?

Kjell
Top achievements
Rank 1
 answered on 27 Mar 2013
4 answers
579 views
i just need to make kendo menu with data source(json). but currently impossible. so i tried to create html list dynamically and bind the data set (ul ID="menu")  and  call from kendomenu function. html list added to page correctly  but  menu not populate. have any idea..?    
Sanjay
Top achievements
Rank 1
 answered on 27 Mar 2013
2 answers
268 views
Hi all,

I've created a minimal jsFiddle which demonstrates the problem very clearly:

http://jsfiddle.net/YNKM6/3/

Two grids bound to the same data. Both grids have the same two columns. One column has a comboBox editor, the other is a value that gets updated based on the comboBox's selection. When the comboBox value is changed, the change event handler updates the value column data on the observable model.

Grid1 has a row template. When the colour column is changed, the Value column is not updated in Grid1, until the user actually moves to the Value cell. Grid2 updates correctly straight away.

Grid2 does not have a row template. When the colour column is changed, the Value column is updated in both grids straight away.

My spidey-sense tells me this is a bug, but any support or work-arounds you can offer would be great. I'd like to use a row template if possible, and will only fall back on a column template if that is the only viable solution.

Thank-you!
Timothy
Top achievements
Rank 1
 answered on 26 Mar 2013
1 answer
247 views
Initialization of the Kendo validator in shared file
I am initializing my validator without rules from a shared file. I need to then add some rules for a separate file only when that file is used.
var validatable = form.kendoValidator({
    validateOnBlur: false
}).data("kendoValidator");

I need to add rules in a separate file that isn't shared
The following code needs to be added from the separate file
{
            rules: {
                radio: function(input) {
                    if (input.filter("[type=radio]") && input.attr("required")) {
                        return $("form").find("[name=" + input.attr("name") + "]").is(":checked");
                    }
                    return true;
                }
            },
            messages: {
                radio: "Please select a status"
            }
        }

How can I merge these rules to the existing validator validation code when that files is included?

Alexander Valchev
Telerik team
 answered on 26 Mar 2013
1 answer
231 views
I have a web service that works fine before I pass in any parameter. Once I change the service to take a parameter I return no data. I am fairly new to asmx web services but here is my code for my service as well as the call.

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]

// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {

    public WebService () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    List<string> datax = new List<string>();
  [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    [WebMethod]
    public object GetAgent(string agentId)
    {
      
      DataClassesDataContext dc = new DataClassesDataContext();
      var ag = from x in dc.Agents
                select x;
      foreach (var item in ag)
      {
        datax.Add(item.FirstName + " " + item.LastName);
      }
      //JavaScriptSerializer jss = new JavaScriptSerializer();
      //retVal = jss.Serialize(ag);
      return datax;
    }
}


  <script>
    var deviceJDS = new kendo.data.DataSource({
      schema: {
        data: "d"  // ASMX services return JSON in the following format { "d": <result> }. Specify how to get the result.
      },
      transport: {
        read: {
          contentType: "application/json; charset=utf-8",
          type: "POST",
          dataType: "json",
          url: "http://localhost:65205/WebService.asmx/GetAgent",
           data: {agentId: 2}

        }
      }
    });


    $("#listview").kendoMobileListView({
      dataSource: deviceJDS
    });
    var app = new kendo.mobile.Application();
</script>



Alexander Valchev
Telerik team
 answered on 26 Mar 2013
2 answers
576 views
We are creating a grid based on the following Demo
The model for the demo has the unit price set up as follows:
[Required]
        [DisplayName("Unit price")]
        [DataType(DataType.Currency)]
        [Range(0, int.MaxValue)]
        public decimal UnitPrice
        {
            get;
            set;
        }

We are attempting to do the same thing in our application, but when we do so, we receive the following error:

The model item passed into the dictionary is of type 'System.Decimal', but this dictionary requires a model item of type 'System.String'

Am I missing something?
I don't see the model for the demo converting the unit price into a string, but the demo doesn't throw an error.
Atlas
Top achievements
Rank 1
 answered on 26 Mar 2013
4 answers
402 views
Hey,

i get a problem with my cascading comboboxes. I can't get the value from the first combobox to put it in the data for the second datasource. So the datasource from combobox2 depends on the value from combobox1. I dont have a clue how to get the value out of combobox1.

I tried several things, but nothing worked for me.

The situation is mentioned below:

$("#categories").kendoComboBox({
                        placeholder: "Select category...",
                        dataTextField: "Category",
                        dataValueField: "Category",                    
                        dataSource: {
                            type: "json",
                            transport: {
                                    read: {
                                        url:"http://xxx/api/item/PostAllCategories",
                                        type:"POST",
                                    }
                            }
                        }      
                    }).data("kendoComboBox");
                     
                    var products = $("#products").kendoComboBox({
                        autoBind: false,
                        cascadeFrom: "categories",
                        placeholder: "Select product...",
                        dataTextField: "Product",
                        dataValueField: "Product",
                        dataSource: {
                            type: "json",
                            transport: {
                                    read: {
                                        url:"http://xxx/api/item/PostAllProducts",
                                        type:"POST",
                                        data:{
/*Here is the Problem, i need the value from categories here in the data field
  If i do it this way my cascading fails and the values aren't displayed in the combobox, so something is wrong here. value = valuefromcategories*/
                                            value: function() {
                                                        return $("#categories").data("kendoComboBox").value();
                                                    }  
                                        }
                                    }
                                }
                        }
                    })

Does anyone has an idea?
John
Top achievements
Rank 1
 answered on 26 Mar 2013
3 answers
84 views
    Do you have the sample file to demo how to insert, update and delete data for WCF RIA JSON endpoint ?
Alexander Valchev
Telerik team
 answered on 26 Mar 2013
1 answer
104 views
Hello all,

Having a strange issue and I can post some sample code if needed.   I have setup the KendoUI grid with .Create, .Update, .Destroy.   Each individually works fine and gets into the method calls and performs the task.  However, once the page loads if I do a create, the insert happens fine, the grid shows my new record at the top of the grid.  This only happens if the chain of events I take is Add New Record calls the create, then if I click the delete button postback does not occur into the delete method.   If I click Edit the Create method gets called again.    If I complete an edit then delete it works fine both methods are called.  The create has the following for example:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Role_Create([DataSourceRequest] DataSourceRequest request, RoleModel role)
{
if (role != null && ModelState.IsValid)
{
DataProvider.Use(s => s.InsertRoles(role.RoleCode, role.RoleDescription));
}

return Json(new[] { role }.ToDataSourceResult(request, ModelState));
}

Now once that occurs the Ajax adds that record it seems.   Then if I click the Delete button on a row, the alert comes up do you want to delete I hit okay.  The row deletes in the grid visually but the call never gets called as I have a break point in my code and the DB is not showing it deleted.   If I click create and create a new record then I click edit, the create method gets called instead of the update so it calls the previous ajax call it seems.   Again this only happens after the first click of the Add New Item that calls the create method.   If I do a create then I manually refresh the page it then works as expected.   It seems also that on the subsequent requests it gets into the previous calls sometimes as well.   Any idea why this would be happening?   Attaching my sample CSHTML and some of the classes to see what I am doing.
Sean Bornstein
Top achievements
Rank 1
 answered on 26 Mar 2013
1 answer
282 views
Hi,

The Kendo DateTimePicker that we are using behaving strangely. On first time load the control behaves as it should and opens the calendar and time selector on their respective select clicks. However, once the user control is reopened, the datetimepicker starts behaving strangely.

The KendoDateTime Picker is bound to one input textbox. On the runtime, the html (working case) looks like this.

<SPAN class="k-picker-wrap k-state-default" jQuery171010970156005264647="31"><br><INPUT style="WIDTH: 100%" id=datetextbox class=k-input value="08/29/2012 04:47 PM" size=22 data-role="datetimepicker" jQuery171010970156005264647="27"><br><SPAN class=k-select unselectable="on"><br><SPAN class="k-icon k-i-calendar" unselectable="on" jQuery171010970156005264647="32">select</SPAN><br><SPAN class="k-icon k-i-clock" unselectable="on" jQuery171010970156005264647="33">select</SPAN></SPAN></SPAN>

However, when I close the user control and reopen it..The calendar starts behaving in an unwanted manner and the time selector when clicked opens the calendar instead. Below is the run time html.

<br><span class="k-picker-wrap k-state-default" jQuery171010970156005264647="62"><br><INPUT style="WIDTH: 100%" id=datetextbox  class=k-input value="08/29/2012 04:52 PM" size=22 data-role="datetimepicker" jQuery171010970156005264647="27"><SPAN class=k-select unselectable="on" jQuery171010970156005264647="63"><SPAN class="k-icon k-i-calendar" unselectable="on" jQuery171010970156005264647="32">select</SPAN><SPAN class="k-icon k-i-clock" unselectable="on" jQuery171010970156005264647="33">select</SPAN></SPAN>

The strange thing here is some jquery functions are being injected and might cause this issue. Has anyone witnessed this behavior and any possible solution for that.

P.S:- The noticeable change is 

Not Working : - 
<SPAN class=k-select unselectable="on" jQuery171010970156005264647="63"> 
Vs Working : - 
<SPAN class=k-select unselectable="on"> 

Yann Struillou
Top achievements
Rank 1
 answered on 26 Mar 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?