Telerik Forums
Kendo UI for jQuery Forum
2 answers
295 views
Hi,
I'm working with kendo listview and datasource.
Dates from Json data are returned as "\/Date(1338364370930)\/".
This is my current date part template:
<dt>@FieldNames.CreateDate :</dt>
<dd>#= (CreateDate == null) ? ' ' : kendo.toString(new Date(parseInt(CreateDate.substr(6))), "d") #</dd>

I've had to add the "new Date(parseInt(CreateDate.substr(6)))" part in order to show correctly the date.
Without this code the date appear \/Date(1338364370930)\/ without conversion. This is my first issue. Why kendo datasource or listview cannot process or convert directly json dates?

My second issue is I'm converting the date to a short format with "d", currently my culture is spanish and the date appears as "5/30/2012" (m/dd/yyyy). This is wrong, in spain it must be "30/5/2012" (dd/m/yyyy). I've checked my internet explorer and the language is set to spanish. Tried with Chrome and with the same result. Any idea? 

Regards
Jose
Jayson
Top achievements
Rank 1
 answered on 03 Aug 2012
1 answer
285 views
Hi everyone!

i have a little problem, i made a kendo ui grid, and i added a Columns Template (checkbox), and agregates function, sum and avarage, it works perfectly.

but i wanna do the fallowing: the user will enable some checkbox , the grid has to refresh , i mean the agregate needs to recalculate again, when the user selects checkboxes.

so, i have 3 rows A , B , C. by default all are selected and agregate are calculated, but it happends that the user removes B, so the grid needs to recalculate de "sum" and "avarage" again for A and C.

this is my code so far: i wanna basicly wanna refresh my agregates with help of a checkbox.  im using Kend ui with razor. any help will be super appriciate!


 @(Html.Kendo().Grid(Model)
                 .Name("Grid")
        
                 .Navigatable()
                 .Columns(columns =>
                              {
                                  columns.Template(@<text>
                                                        <input name="LstModelSel" type="checkbox" title="LstModelSel"  onclick="Refresh(@item.TotalOutstanding)" value="@item.ExposureNummer"
                     
                                                            @if (Model.Any(p => p.ExposureNummer == item.ExposureNummer))
                                                            {
                                                                @("checked=checked")
                                                            }
                        
                                                            />
                                                    </text>)
                                      .HeaderTemplate(@<text>
                                                           <input id="LstModelSel" type="checkbox"   title="LstModelSel"
                          
                                                               @if (Model.Any())
                                                               {
                                                                   @("checked=checked")
                                                               }
                                                               onclick="return LstModelSel_onclick()" />
                                                       </text>)
                                      .Width(50)
                                      .HtmlAttributes(new { style = "text-align:center" })
                                      .HeaderHtmlAttributes(new { style = "text-align:center" });

                                  columns.Bound(p => p.ExposureNummer);

                                  columns.Bound(p => p.GroupNummer);
                                  columns.Bound(p => p.Name);
                                  columns.Bound(p => p.TypeofLoan);
                                  columns.Bound(p => p.TotalLimit);
                                  columns.Bound(p => p.TotalOutstanding).GroupFooterTemplate((@<text>  <div> Total: @item.Sum  </div>   <div> Average: @item.Average   </div>    </text>));


                                  columns.Bound(p => p.ArpovalDate);
                                  columns.Bound(p => p.Status);
                                  columns.Bound(p => p.Rating);
                                  columns.Bound(p => p.EL);
                                  columns.Bound(p => p.LostProvision).GroupFooterTemplate((@<text>  <div> Total: @item.Sum  </div>   <div> Average: @item.Average   </div>    </text>));

                              })
                 .Pageable()
                //.Events(e => e.DataBound("Refresh()"))
                                    

                 .DataSource(dataSource => dataSource
                                               .Server()
                                               .PageSize(20)

                                               .Aggregates(ListModel =>
                                                               {

                                                                   ListModel.Add(p => p.TotalOutstanding).Average();
                                                                   ListModel.Add(p => p.TotalOutstanding).Sum();
                                                                   ListModel.Add(p => p.LostProvision).Average();
                                                                   ListModel.Add(p => p.LostProvision).Sum();

                                                               })
                                               .Group(groups => groups.Add(p => p.ExposureNummer)
                                               )/*Agregates*/))
  }  
   
 
}


<script type="text/javascript">
    $(document).ready(function () {
        $('#LstModelSel').click(function () {
            $("#Grid tbody input:checkbox").attr("checked", this.checked);
        });
    });

    function Refresh(V) {
        var sum = 0;
        var val = V;
    
        
        document.getElementById('re').value = val;
    }



    function LstModelSel_onclick() {

    }

</script>

Jose
Top achievements
Rank 1
 answered on 03 Aug 2012
0 answers
118 views
HI,

Im using Kendo q2 latest version. I have implemented listview. I have a button for EDIT mode and in my edittemplate , I have defined

editTemplate: kendo.template($("#editTemplate").html())

But when I click on this Edit button, its not entered into Edit mode.

Can u just suggest any help for this?

Thanks and regards,
Durga bhavani.G 

 

 

durga bhavani
Top achievements
Rank 1
 asked on 03 Aug 2012
0 answers
96 views
Hi friends,how to install windows 7 can anyone tell me step by step..
Alex
Top achievements
Rank 1
 asked on 03 Aug 2012
0 answers
101 views
Hi all,

I am just wondering is there any way to find record status  in data source , when we are doing CRUD operation ??
I mean so and so record is inserted / updated / deleted ...

Thanks in advance.

 
Ambica
Top achievements
Rank 1
 asked on 03 Aug 2012
3 answers
241 views
Hi,
My Popup Issue

 @(Html.Kendo().Window()
        .Name("roleRightsWindow")
        .Width(600)
        .Height(500)
        .Title("Rights List")
        .Actions(actions => actions.Close())
        .Visible(false)
        .Modal(true)
.LoadContentFrom("_DARoleRightsAssignedAllForPopUp", "DataAccess", new { roleId = 4, roleTypeId = 1 })
)
The above works just fine upon page load (for basic testing), but I want to call the same controller and action but with various values for the parameters gotten from one column in a grid and upon a button click of another column in the same grid.
I tried to find an example but could not.
Help would certainly be appreciated.
Thanks,
Murph
Alex Gyoshev
Telerik team
 answered on 03 Aug 2012
2 answers
453 views

Hi,

I have a grid with inline editing enabled set as a template for a master grid.  However when i click on the Edit button, make a change and then Update the create function is called (3 times).  I have checked the forums and the closest possible answer was that the other user had additional ',' characters in their javascript.  I seem to have no extra character.

I can successfully use the edit command in the outer grid and in other pages / grids that have no detail records.

Please see below for the full .cshtml file i am using with MVC4 / .NET 4.5RC.

Thanks,

@section scripts {
 
    @Scripts.Render("~/bundles/kendo")
 
    @Styles.Render("~/Content/kendo")
 
    <script src="~/Scripts/kendo/2012.2.710/cultures/kendo.culture.en-GB.min.js"></script>
 
    <script type="text/javascript">
 
  
 
        //set current culture to the "en-GB" culture script.
 
        kendo.culture("en-GB");
 
  
 
    </script>
 
}<style>
 
    .ysiFieldLabel {
 
        width: 100px;
 
        text-align: right;
 
        padding-right: 5px;
 
    }
 
  
 
    .ysiFieldControl {
 
        width: 12.4em;
 
    }
 
</style>
 
  
 
@section featured {
 
    <section>
 
        <div class="k-content">
 
            <div id="grid"></div>
 
        </div>
 
    </section>
 
}
 
  
 
<script type="text/x-kendo-template" id="detailTemplate">
 
    <div class="tabstrip">
 
        <ul>
 
            <li class="k-state-active">
 
                Details
 
            </li>
 
            <li>
 
                Projects
 
            </li>
 
        </ul>
 
        <div>
 
            <div class='details'>
 
                <ul>
 
                    <li><label>Name: </label>#= Name #</li>
 
                    </ul>
 
            </div>
 
        </div>
 
        <div>
 
            <div class="projects"></div>
 
        </div>
 
    </div>
 
</script>
 
  
 
<script type="text/x-kendo-template" id="toolbarTemplate">
 
    <div class="toolbar">
 
        <div class="toolbar" style="float:left">
 
            <a class="k-button k-button-icontext">
 
                <span class="k-icon k-add" />
 
                New
 
            </a>
 
        </div>
 
    </div
 
</script>
 
  
 
<script>
 
    $(document).ready(function () {
 
        var grid = $("#grid").kendoGrid({
 
            dataSource: {
 
                transport: {
 
                    read: {
 
                        url: '/Releases/ReleaseItems?projectId=@(Model.TFSProject.Id)',
 
                        dataType: "json",
 
                        contentType: "application/json; charset=utf-8"
 
                    },
 
                    create: {
 
                        url: '@Url.Action("ReleaseItemCreate", "Releases")',
 
                        dataType: "json",
 
                        contentType: "application/json; charset=utf-8",
 
                        type: "POST"
 
                    },
 
                    destroy: {
 
                        url: '@Url.Action("ReleaseItemDestroy", "Releases")',
 
                        dataType: "json",
 
                        contentType: "application/json; charset=utf-8",
 
                        type: "POST"
 
                    },
 
                    parameterMap: function (data, operation) {
 
//                        if (operation !== "read" && options.models) { // batch mode
 
                        return kendo.stringify(data);
 
//                        }
 
                    }
 
                },
 
                schema: {
 
                    type: "json",
 
                    data: "Items", total: "TotalItemCount",
 
                    model: {
 
                        id: "Id",
 
                        fields: {
 
                            Id: { type: "number", editable: false },
 
                            Name: { type: "string", editable: false },
 
                            ApplicationName: { type: "string", editable: false },
 
                            Version: { type: "string", editable: false },
 
                            ReleaseDate: { type: "date", editable: false },
 
                            ProjectId : { type: "number" }
 
                        }
 
                    }
 
                },
 
                pageSize: 3,
 
                serverPaging: true,
 
                serverFiltering: false,
 
                serverSorting: false
 
            },
 
            height: 500,
 
            filterable: true,
 
            sortable: false,
 
            pageable: true,
 
            columnMenu: true,
 
            resizable: true,
 
            toolbar: kendo.template($("#toolbarTemplate").html()),
 
            editable: "inline",
 
  
 
            detailTemplate: kendo.template($("#detailTemplate").html()),
 
            detailInit: detailInit,
 
  
 
            columns: [
 
                { field: "Id", title: "Id", filterable: true, width: "10px" },
 
                { field: "Name", title: "Name", filterable: false, width: "80px" },
 
                { field: "ApplicationName", title: "ApplicationName", width: "100px" },
 
                { field: "Version", title: "Version", width: "80px" },
 
                { field: "ReleaseDate", title: "ReleaseDate", width: "100px", format: "{0:G}" },
 
                { command: ["destroy", { template: '<a class="k-button k-buttonicon-text"><span class="k-icon k-i-custom"></span>Build</a>', click: buildProject }], title: " ", width: "100px" }
 
            ]
 
        });               
 
    });
 
  
 
    function buildProject() {
 
          
 
    }
 
      
 
    function detailInit(e) {
 
        var detailRow = e.detailRow;
 
  
 
        detailRow.find(".tabstrip").kendoTabStrip({
 
            animation: {
 
                open: { effects: "fadeIn" }
 
            }
 
        });
 
  
 
        detailRow.find(".projects").kendoGrid({
 
            dataSource: {
 
                transport: {
 
                    read: "/Releases/ReleaseItemProjects?id=" + e.data.Id + "&projectId=@(Model.TFSProject.Id)",
 
                    create: {
 
                        url: '@Url.Action("ReleaseProjectItemCreate", "Releases")',
 
                        dataType: "json",
 
                        contentType: "application/json; charset=utf-8",
 
                        type: "POST"
 
                    },
 
                    update: {
 
                        url: '@Url.Action("ReleaseProjectItemUpdate", "Releases")',
 
                        dataType: "json",
 
                        contentType: "application/json; charset=utf-8",
 
                        type: "POST"
 
                    },
 
                    parameterMap: function (data, operation) {
 
                        //                        if (operation !== "read" && options.models) { // batch mode
 
                        return kendo.stringify(data);
 
                        //                        }
 
                    }
 
                },
 
                schema: {
 
                    type: "json",
 
                    data: "Items", total: "TotalItemCount",
 
                    model: {
 
                        fields: {
 
                            ReleaseProjectId: { type: "number", editable: false },
 
                            ReleaseProjectName: { type: "string", editable: false },
 
                            ReleaseProjectVersion: { type: "string", editable: false },
 
                            Type: { type: "string", editable: false },
 
                            Build: { type: "boolean", editable: true },
 
                            ProjectId: { type: "number", editable: false },
 
                            ReleaseId: { type: "number", editable: false }
 
                        }
 
                    }
 
                },
 
                pageSize: 5,
 
                serverPaging: true,
 
                serverFiltering: false,
 
                serverSorting: false
 
            },
 
            scrollable: false,
 
            sortable: false,
 
            pageable: true,
 
            filterable: false,
 
            columnMenu: true,
 
            columns: [
 
                { field: "ReleaseProjectName" },
 
                { field: "ReleaseProjectVersion" },
 
                { field: "Type" },
 
                { field: "Build", width: "50px", template: '<input type="checkbox" #= Build ? checked="checked" : "" # disabled="disabled" ></input>' },
 
                { command: ["edit"], title: " ", width: "220px" }
 
            ],
 
            editable: "inline",
 
        });
 
    }
 
</script>
Ednei
Top achievements
Rank 1
 answered on 03 Aug 2012
3 answers
156 views
Hi!

I have been spending the last few hours on this problem. I am trying to present a view that contains a html select element and uses a layout element. My code is as follows:

  <head>
  <title>Branch</title>
   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" >
    <script src="./js/jquery.min.js"></script>
    <script src="./js/jquery.mobile-1.1.1.min.js"></script>
    <script src="./js/kendo.mobile.min.js"></script>


    <link href="./styles/kendo.common.min.css" rel="stylesheet" />
    <link href="./styles/kendo.mobile.all.min.css" rel="stylesheet" />
    
    </head>
  <body>
       <div data-role="view" id="myBookings" data-id="myBookings" data-layout="overview" data-title="My Bookings">
          Current Branch: <select id="branch-select">
          </select>
          


      </div>
      
      <div data-role="layout" data-id="overview">
          <header data-role="header">
              <div data-role="navbar">
                  <span data-role="view-title"></span>
              </div>
          </header>
      </div>
      <script>
          var app = new kendo.mobile.Application($(document.body)/*, {initial:"myBookings"}*/);
      </script>
      
  </body>

This almost works. However, if I inspect the webpage, the <div> element of the view is in the website three times. For ios users, this means that they can navigate through all three select elements using the "previous"/"next" buttons when the select is expanded.

I already tried uncommenting the commented line with the initial setting. However, this does not work at all. According to the console, the browser appears to try to load a file named "myBookings".

How do i get this to work so that the ios devices treat the select as one?
Gabriel
Top achievements
Rank 1
 answered on 03 Aug 2012
10 answers
453 views
Just wondering if the Grid widget will have search filtering integrated into it for the official release?
Danny
Top achievements
Rank 1
 answered on 03 Aug 2012
3 answers
131 views
Is there any way I can override the silver ipad look and feel with the blue iphone theme? 

I am building a very large application for several devices, and depending on the device, I may execute different logic. Having said this, I am trying to avoid doing this by passing platform as a parameter in kendo.mobile.Application because I fear that it may have some side effects on the platform-specific logic I have implemented. 

Are there some classes that can be inherited by my navbars/buttons/other elements to achieve this? 
Kamen Bundev
Telerik team
 answered on 03 Aug 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Drag and Drop
Application
Map
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?