Telerik Forums
Kendo UI for jQuery Forum
1 answer
240 views
Hi All,

I have been trying to get the datasource to refresh or update itself with the contents of a PUT response it sends to an odata service.  I know normally the PUT would return 204 with updating  a record, but I am returning a 200 with the contents that where updated.  The main reason for this is that a timestamp (ETAG) value is updated and returned in the response.  So the next time an edit is done on it should work, but currently it does not.

I have checked fiddler request/responses they are correct, it just that data source is not being refreshed with the contents being sent in the response.

Do I have to do a force refresh on the datasource and retrieve that page of data or is there another way?

The timestamp field is nested in the json response so I don't know if that is the cause or not.

Here is an example of the  request

PUT https://localhost:444/admin/v2/accounts(6) HTTP/1.1
Host: localhost:444
Connection: keep-alive
Content-Length: 325
Cache-Control: max-age=0
Accept: application/json, text/javascript, */*; q=0.01
Origin: https://localhost:444
X-Requested-With: XMLHttpRequest
If-Match: "AAAAAAAADJ0="
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36
Content-Type: application/json
Referer: https://localhost:444/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6

{"Id":"6","Name":"Test Account  5","Registered":null,"WebsiteUrl":"Testing","IsEnabled":true,"AccountType":"Retailer","Tracking":{"CreatedBy":"JhH1TV-f-P8cZgV19W0bhyI3UBLlHdbh79ZkzhnJSKA","CreatedOn":"2013-07-26T14:08:22.787","ModifiedBy":"JhH1TV-f-P8cZgV19W0bhyI3UBLlHdbh79ZkzhnJSKA","ModifiedOn":"2013-07-26T16:54:20.57","Timestamp":"AAAAAAAADJ0="}}

Here is an example of the response.

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
ETag: "AAAAAAAADJ4="
Access-Control-Allow-Origin: *
DataServiceVersion: 3.0
Date: Fri, 26 Jul 2013 17:05:14 GMT
Content-Length: 425

{
  "odata.metadata":"https://localhost:446/admin/v2/%24metadata#accounts/@Element","Id":6,"Name":"Test Account  5","Registered":null,"WebsiteUrl":"Testing","IsEnabled":true,"AccountType":"Retailer","Tracking":{
    "CreatedBy":"JhH1TV-f-P8cZgV19W0bhyI3UBLlHdbh79ZkzhnJSKA","CreatedOn":"2013-07-26T14:08:22.787","ModifiedBy":"JhH1TV-f-P8cZgV19W0bhyI3UBLlHdbh79ZkzhnJSKA","ModifiedOn":"2013-07-26T17:05:13.9989111Z","Timestamp":"AAAAAAAADJ4="
  }
}

As you can see the ETag/Timestamp have been updated.

Any suggestions

Regards

Richard....
Richard
Top achievements
Rank 1
 answered on 26 Jul 2013
1 answer
89 views
Hello,

Here is a jsbin link to the problem I'm facing.

I want the autocomplete textbox to be docked left and right in a relative div and I ain't sure how to manage to width of the dropdown list items.

Also, while typing in the textbox, the dropdown seems to go up on the second letter typed.

Any input would be appreciated.

Thanx!
royguillaume
Top achievements
Rank 1
 answered on 26 Jul 2013
4 answers
112 views
Hi,

I am lazy loading some data into my chart and wondering how do I create a status message on the chart, similar to http://www.highcharts.com/stock/demo/lazy-loading?

Thanks,
Tonih
Tonih
Top achievements
Rank 1
 answered on 26 Jul 2013
2 answers
1.1K+ views
Hi,

I was wondering what is considered the "best" way to determine if a PanelBarItem is expanded or not? So far what I've been able to come up with is to check the "aria-expanded" property or see if the child <ul> is visible, both of which feel a bit dirty. Is there a better way, or is one of these two methods considered "better" than the other?

For context, I'm retrieving the item to check by using jquery.closest from one of the child items. Example:
function (id) {
  var child = $("#s-list-objectChild-" + id);
  var parent = child.closest("[id^='s-list-object-']");
  if (parent.isExpanded()) // Perform check here
    doSomething();
  else
    doSomethingElse();
}
Thanks,
Jeff
Jeff
Top achievements
Rank 1
 answered on 26 Jul 2013
2 answers
142 views
Hi All,

Can someone point me to the right data- attribute for virtual scrolling on a grid?

This is a the configuration option on the GRID

scrollable.virtual Boolean(default: false)

I have tried the following.

data-scrollable = "virtual"
data-scrollable-virtual="true"
data-scrollable = "virtual = true"

None of these work.  I would like virtual scrolling, but if not supported using data- attributes then can I modify the grid once it is  initialized?

I tested it by making sure the page count was less then the number of items in odata results set.  Fiddler shows the first request being send with the correct top value.

Thanks for any help.

Regards

Richard...
Richard
Top achievements
Rank 1
 answered on 26 Jul 2013
1 answer
809 views
I have been stuck with this problem without much luck. I've gone down multiple paths and done google search but can’t seem to find a solution that works. Any help would be greatly appreciated.
I am using Kendo MVC grid wired up for CRUD.

@model IEnumerable<CustomerModels>
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
    {
        columns.Bound(Customer => Customer.Name);
        columns.Bound(Customer => Customer.Number);
        columns.Bound(Customer => Customer.Phone);
        columns.Bound(Customer => Customer.DOB).Format("{0:d}").EditorTemplateName("Date");
        columns.Command(command => { command.Edit(); });
    })
                .DataSource(dataSource => dataSource
                            .Ajax()
                            .PageSize(20)         
                            .Read(read => read.Action("FilterMenuCustomization_Read", "Home"))
                                    .Model(model => { model.Id(c => c.Phone); model.Field(c=>c.DOB);})
                                           .Update(update => update.Action("FilterMenuCustomization_Update", "Home"))
                                   )
                                   
        .Pageable()
        .Sortable()
           )

When i try to edit the date field using Date Picker or even without any change to existing date, If i try to submit It gives me Error message as "DOB is not valid date".
Ex. 25/07/2013
I have included Culture and EditorTemplates as mentioned in some of the solutions i found on internet, But no help.
Any idea as to what i am doing wrong?
  
Petur Subev
Telerik team
 answered on 26 Jul 2013
1 answer
178 views
Does anyone know how to render a hierarchical grids within a View using the same model?  In my example,  the model i'm using "System.Data.DataTable" the main grid should display a list of 'projects' and the sub grid should display correlating 'designs' as a child grid.  I'm using DataTable because each customer could have different columns for their 'projects' and 'designs' in data.. Therefore, I cannot go with the fixed column solution, it MUST be dynamic columns.  When I'm using DataTable the parent grid and the child grid both are displaying the same columns because it's referencing the same model. Here's the code in my view:

    @(Html.Kendo()
        .Grid<System.Data.DataTable>()
        .Name("ProjectGrid")
        .ClientDetailTemplateId("template")
            .Columns(columns =>
            {
                foreach (System.Data.DataColumn column in Model.Columns)
                {
                    string strFormat = "", strTitle = column.Caption;
                    if (column.DataType == typeof(System.DateTime))
                        strFormat = "{0:" + System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + "}";


                    columns
                        .Bound(column.ColumnName)
                       .Groupable(column.ColumnName != "Id" && column.ColumnName != "AsyncErrorMessage")
                       .Title(strTitle)
                       .Hidden(column.ColumnName == "Id" || column.ColumnName == "AsyncErrorMessage")
                       .Format(strFormat)
                       .Width(200);
                }

            })
        .Pageable(paging=>paging.PageSizes(new int[]{10, 20 , 30, 50} ))
        .Sortable()
        .Navigatable()
        .Filterable()
        .Groupable()
        .Selectable(selectable => selectable
                .Type(GridSelectionType.Row))
        .ColumnMenu()

            .Resizable(resize => resize
                        .Columns(true))
        .DataSource(dataSource => 
            dataSource
                .Ajax()
                    .Model(model =>
                        {
                            foreach (System.Data.DataColumn column in Model.Columns)
                            {
                                model.Field(column.ColumnName, column.DataType);
                            }
                        })
                .Read(read => read.Action("GetProjects", "Designer"))
                .PageSize(20)  
        )        
        .HtmlAttributes(new { style = "height:100%" })
        .Scrollable()

    )


<script id="template" type="text/kendo-tmpl">
@(Html.Kendo()
    .Grid<System.Data.DataTable>()
    .Name("DesignerDesignGrid_#=Id#")
        .Columns(columns =>
        {
            foreach (System.Data.DataColumn column in Model.Columns)
            {
                string strFormat = "", strTitle = column.Caption;
                if (column.DataType == typeof(System.DateTime))
                    strFormat = "{0:" + System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + "}";


              columns
                        .Bound(column.ColumnName)
                       .Groupable(column.ColumnName != "Id" && column.ColumnName != "AsyncErrorMessage")
                       .Title(strTitle)
                       .Hidden(column.ColumnName == "Id" || column.ColumnName == "AsyncErrorMessage")
                       .Format(strFormat)
                       .Width(200);
            }
        })
        //.Events(events => events.Change("getSelectedRowId"))
    .DataSource(datasource => datasource
        .Ajax()      
        .Model(model =>
                        {
                            foreach (System.Data.DataColumn column in Model.Columns)
                            {
                                model.Field(column.ColumnName, column.DataType);
                            }
                        })  
        .PageSize(5)
        .Read(read => read
            .Action("GetDesigns", "Designer", new  { projectId = "#=Id#" })))
        .Pageable()
        .Sortable()
        .ToClientTemplate()
    )
    </script>

<script>
    var selected;
    function dataBound() {
        this.expand(this.tbody.find("tr.k-master-row").first());
    }
</script>
Vladimir Iliev
Telerik team
 answered on 26 Jul 2013
1 answer
201 views
Is there a way to set the header template for a grouped listview in the HTML markup similar to the attempt below, which does not work for me?

<ul data-role="listview" data-style="inset" data-type="group" data-auto-bind="false" data-source="firmDataSource" data-template="firmTemplate" header-template="<h2>Letter ${value}</h2>">
</ul>

I have seen examples where the header template can be defined in javascript, but have not seen an example of doing it this way.








Richard
Top achievements
Rank 1
 answered on 26 Jul 2013
9 answers
315 views
There seems to be a pesky problem in this most recent release. It seems to have something to do with some icons on the toolbar collapsing/expanding.

I accept that I may be doing something wrong, or theres some other order I need to be putting the collapsing/expanding tools on the toolbar.

So i'd like some advice, is there a way around this issue?

for instance the unlink doesnt appear (it used to mind you) unless you already have inserted a link into the editor, in which case the tool bar grows.

Is there a way I can arbitrarily say "ok after this many icons, drop down to the next line"?

that way i'd just place all the collapsing ones (especially the createTable one) on a second line by itself


$("#editor").kendoEditor({
    tools: [
     "bold",
     "italic",
     "underline",
     "strikethrough",
            {
                name: "fontName",
                items: [].concat(kendo.ui.Editor.prototype.options.fontName[8], [{ text: "Arial", value: "Arial" }, { text: "Verdana", value: "Verdana" }]),
            },
            {
                name: "fontSize",
                items: [].concat(kendo.ui.Editor.prototype.options.fontSize[0], [{ text: "13px", value: "13px" }, { text: "15px", value: "15px" }])
            },
            "formatting",
            "foreColor",
            "backColor",
            "superscript",
            "subscript",
            "justifyLeft",
            "justifyCenter",
            "justifyRight",
            "justifyFull",
            "insertUnorderedList",
            "insertOrderedList",
            "indent",
            "outdent",
            "createLink",
            "unlink",
            "viewHtml",
            "createTable",
            "addRowAbove",
            "addRowBelow",
            "addColumnLeft",
            "addColumnRight",
            "deleteRow",
            "deleteColumn"]
});
Alex Gyoshev
Telerik team
 answered on 26 Jul 2013
3 answers
122 views
http://docs.kendoui.com/api/mobile/listview#configuration-template

I am using templates, as described in the above link. In the docs is says, "The ListView automatically wraps the template content in <li> tag. Putting a <li> tag inside the template creates invalid nesting of elements."

So how do I add a class or another attribute to the LI item?
Bart
Top achievements
Rank 1
 answered on 26 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?