Telerik Forums
Kendo UI for jQuery Forum
2 answers
446 views
I have a master-detail grid and I want to use a Kendo NumericTextBox as ClientTemplate for one of the columns in the detail grid:

columns.Bound(x => x.MaximumWindowWeeks).ClientTemplate(this.Html.Kendo().NumericTextBox<int>().Name("Test").ToClientTemplate().ToHtmlString());

When expanding the details for a given row, I get the error below and none of the rows are rendered:

SyntaxError: unterminated string literal
...itle":"Maximum Window Weeks","template":"<input id=\"Test\" name=\"Test\" type=\...

Do I need to somehow "escape" the column client template, since I'm defining it as part of another client template?

Thanks!
Marius
Top achievements
Rank 1
 answered on 12 Jul 2013
3 answers
72 views
I can't seem to find a way to find my old answered posts in this forum. Is there a way?
Alex
Telerik team
 answered on 12 Jul 2013
3 answers
226 views
I'm looking to use Kendo to enhance an existing PHP web app at the company I work for. Currently all of the data in the app is extracted from a MySQL database, processed and setup as an array, then output as an HTML table.

I'd like to use Kendo as a 'drop-in' replacement for the tables, which means all the data will come from PHP arrays. I've read the docco and got started using the PHP Wrapper, and the following code:
$dataSource = new \Kendo\Data\DataSource();
$dataSource->data($my_array)

Most things are working great, and I'm very impressed. However there's one problem - dates aren't sortable. This is a pretty killer issue for the web app, given that it has a lot of inventory and sales information.

I think the problem is the format of the dates - currently they are 'raw' dates in d/MM/yyy format (no leading  0 on days). But I have also experimented with injecting them them as dd/MM/yyyy, yyyy-mm-dd, and unix time stamps (second since the epoch, otherwise know as date('u') in PHP). But no matter what I do, the dates always sort as if they are just numbers.

Does anyone know what date format is acceptable to Kendo UI's PHP Wrapper, when coming from a PHP array?

I've succesfully used format({0:c}) to represent currency information, and I've read that format({0:d}) can accomplish something with dates, but I've had no luck. I've also tried format({0:d/MM/yyyy}) and a handful of others, but it doesn't change the data.

Does the ->format() function have any relationship to sorting? Or does it just change the visual output of the columns? 

I'm aware that I can hook Kendo up to the data sources directly (and that this is a preferred option), but as I said I'm attempting to use this as a 'drop-in' replacement for tables right now. It's not worth the effort of rewriting so much of the app at this stage, I'm just evaluating. Further, both Easy UI and dHTMLxGrid are capable of taking a PHP array that includes a date and treating it correctly, so I'd be very surprised if Kendo couldn't.

I would have thought this was a pretty common use case, but I can't find anything specific to this example in the docs, tutorials, API etc. Can anyone assist?

Regards,
Sam Miller
Alexander Valchev
Telerik team
 answered on 12 Jul 2013
1 answer
237 views
Hi, 
when I resize the kendoGrid header columns , the background color (or borders) of the content table don't stretch ! I have attached two images which can explain better what I mean.
Regards,
Atiyeh
Dimo
Telerik team
 answered on 12 Jul 2013
1 answer
170 views
Hi,

Is there any example on how to use data from data source in php create update, insert, delete ect?
Sebastian
Telerik team
 answered on 12 Jul 2013
1 answer
1.4K+ views
I have a grid bound to an MVC Model.

I need to create a custom footer where in every cell I place custom html.

Is this possible?
Dimo
Telerik team
 answered on 12 Jul 2013
1 answer
230 views
Hi,

I am new to Kendo UI and are trying out the demo on iPad to check compatibility.

http://demos.kendoui.com/web/grid/virtualization-remote-data.html

I noticed that whilst the grid scrolls, it does not show horizontal / vertical scroll bars in either Safari or Chrome on iOS (6.1.3).  Is this something due to be fixed?

Thanks,
Ben
Alexander Valchev
Telerik team
 answered on 12 Jul 2013
5 answers
394 views
I am using MVVM to display data from a webapi datasource over JSON.

The requirements of my application are such that i have complex screens with a heirarchical data structure and a combination of UI elements that manage the data.  Many of these constructs have a parent/child relationship, with a parent object and a nested collection (such as a list of addresses).  These collections are typically presented in a KendoUI Grid.

The server requires that I track each field that changes for each entity, no matter it's level of nesting.  I need to know the overall state of the entity/object (Added by client, Modified, Unchanged or Deleted) as well as what fields have changed if the status is Modified.  I've come up with a system that uses recursion to setup the MVVM change event to be bound to a function that adds the fields names to a 'ChangedFields' list throughout the data structure that is obtained from the server, this is working well.  I have also implemented an 'ObjectState' property on each object to track the overall state of the object.

In order to perform 'soft deletes' on the client I set the 'ObjectState' property to 'Deleted' (which is an int value of 3) and then need to hide it off the grid.  In order to do that, I've been using RowTemplates and setting the style to 'display:none' on the rows that are soft deleted.  Once the data is sent to the server, any items marked for delete are actually deleted from the database and I have to refresh the screen with the new data for the viewmodel.

The use of RowTemplates has a lot of downsides:
  1. The HTML output of the table doesn't align properly
  2. Many of the fields in the 'Columns' setup of the grid are ignored
  3. Custom editors are difficult to implement
  4. The entire scheme requires me to reload the viewmodel and call 'bind' again
The following fiddle shows the problem with grid alignment and the entire 'soft delete' structure in general: http://jsfiddle.net/cn172/XBY3f/72/

  1. How do I fix the grid alignment issue?
  2. How can I reload data into the viewmodel without calling 'bind' again?  Calling 'bind' again is working in this fiddle, but in my more complex app I am getting errors from  Kendo internals, something related to binding events from what I can tell.  I have trouble getting the grids to reload also.
Alexander Valchev
Telerik team
 answered on 12 Jul 2013
1 answer
213 views
Let's say employees are choosing health insurance plans, and as part of that process, they can ask the application to show how many of a particular kind of doctor can be found in their general location. They want the application to rank the results in descending order (most to least) while continuing to show the locations (by zipcode) where these doctors can be found.

At first the grid would be displayed without any grouping; the employee trying to decide between health insurance plans would drag the plan name column header up to the grouping panel, in order to produce the listing shown below.  NOTE: At present the insurance plans are being sorted alphabetically  when the grid is grouped by Plan-Name:

Gold
Platinum
Silver

Can the grid be made to sort as shown here, i.e. by SUM(DOCTORS) DESCENDING?


PLAN-NAME.................ZIPCODE....................DOCTORS
Platinum
................................................10045.........................................7
................................................10047.........................................12
................................................10050.........................................3
                           TOTAL DOCTORS.........................................22


Gold
................................................10044.........................................4
................................................10048.........................................2
................................................10052.........................................3
                           TOTAL DOCTORS.........................................9


Silver
................................................10041.........................................2
................................................10042.........................................2
................................................10055.........................................1
                           TOTAL DOCTORS........................................5
Petur Subev
Telerik team
 answered on 12 Jul 2013
2 answers
346 views
Hi,

I am using a grids with fixed height and a footer row that shows the number of elements. When the data is loaded, the footer row is displayed "outside" the grid (directly below the grid) and will move into the grid when loading is finished.

With that effect, all my grids are displayed a bit larger first, and will be "re-sized" to the height I specified when the data is loaded. That doesn't look nice.

Is there any way to change this behavior? I would like to have the footer row at its final location from the beginning.

This is how I create my grid on the cshtml page:

@(Html.Kendo().Grid<WebSAT.Models.ServiceModel>()
    .Columns(c =>
    {
        c.Bound(m => m.Id)
            .Filterable(false)
            .Groupable(false)
            .Title(Resources.Id)
            .HeaderTemplate("<strong>" + Resources.Id + "</strong></div>");
        c.Bound(m => m.Name)
            .Filterable(false)
            .Groupable(false)
            .Title(Resources.Name)
            .HeaderTemplate("<strong>" + Resources.Name + "</strong>");
        c.Bound(m => m.Type)
            .Filterable(true)
            .Groupable(true)
            .Title(Resources.Type)
            .HeaderTemplate("<strong>" + Resources.Type + "</strong>");
        c.Bound(m => m.DisabledText)
            .Filterable(true)
            .Groupable(true)
            .Title(Resources.Disabled)
            .HeaderTemplate("<strong>" + Resources.Disabled + "</strong>")
            .ClientFooterTemplate("<strong>" + Resources.GridFooterCount + " #=count#" + "</strong>");
    })
    .DataSource(ds => ds
        .Ajax().ServerOperation(false)
        .Model(m => m.Id(s => s.Id))
        .Sort(sort => {
            sort.Add(p => p.Name).Ascending();
        })                
        .Aggregates(aggregates => {
            aggregates.Add(m => m.DisabledText).Count(); })
        .Read(r => r.Action("GetAllServices", "Home")))
    .Events(e => e
            .Change("gServices_Change")
            .DataBound("gServices_DataBound"))
    .Filterable(filterable => filterable
        .Extra(false))
    .HtmlAttributes(new { style = "height:385px;" })
    .Name("gServices")
    .Groupable()                   
    .Selectable()
    .Sortable()
    .Scrollable(scrolling => scrolling.Height("auto")))

Regards
Sven
Sven
Top achievements
Rank 1
 answered on 12 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?