Telerik Forums
Kendo UI for jQuery Forum
2 answers
156 views
Hi,
I have a page that has three different datasources bound to a host of grids, text boxes, drop downs, etc. All three datasources are being saved at the same time via a single button that fires the sync event for all three datasources. I need to update a field in one of the grids with a calculated value from a different grid (bound to a different datasource) WITHOUT calling the sync function sending updates to the server. I can successfully retrieve the value from the source grid in the change event, but I am not sure how to assign that value to the field in the other datasource. Any ideas?

Thanks
JCSCo
Top achievements
Rank 1
 answered on 21 Aug 2014
5 answers
901 views
Hello,

i would like to use multiselect only for selecting multiple items but not add/edit. So i do not Need it editable. can i achieve that? If i make it readonly then i cannot select item even. please suggest what to do.

Thanks

Anamika
Alexander Popov
Telerik team
 answered on 21 Aug 2014
1 answer
171 views
I have an error dialog window I need to open where the content is the result of a Http/REST error from the server.  How do I set the content of the body of the window dynamically?
Petur Subev
Telerik team
 answered on 21 Aug 2014
3 answers
292 views
Hi,

I'm trying to bind a MultiSelect with Angular JS using k-ng-model. It seems to work when I select elements, but not when displaying the control (nothing is pre-selected).

Code from Angular controller:
$scope.selectOptions = {
        placeholder: "Select roles...",
        dataTextField: "roleName",
        autoBind: false,
        dataSource: $scope.roles,
         
select: function(e) {
console.log("Event: "+e.item);
}
    };


HTML:
<div data-kendo-multi-select
data-k-options="selectOptions"
data-k-ng-model="user.roles"
style="width: 300px">


Georgi Krustev
Telerik team
 answered on 21 Aug 2014
1 answer
217 views
I am exploring the Kendo UI Gantt chart to fulfill a requirement in my application, to allow users to drop events (tasks) onto a chart for planning purposes.  Two questions I was hoping for some feedback on would be - 

1 - Is it possible to explicitly set a start and end date for the Gantt chart?  For instance, could I specify that the Gantt should show the current month, through 6 months into the future, regardless of any tasks being assigned to a date in the future?

2 - Is it reasonable to think that I can manually initialize a new task in the chart, via dragging and dropping an object from outside the Gantt, into the viewable Gantt area?

Alex Gyoshev
Telerik team
 answered on 21 Aug 2014
8 answers
1.4K+ views
Hi,

I'm building off the KendoGrid "inline editing" demo. I want the destroy url to be simply:

/api/company/delete/id ( for example, /api/company/delete/17 )

What I'm getting is the URL I specified with the querystring '?id=17' appended

/api/company/delete?id=17

So how do I get the request in REST format instead of URI format?

Many thanks in advance,

Robert

Here's my code:
$(document).ready(function() {
       var dataSource = new kendo.data.DataSource({
           transport: {
               read:  {
                   url: "/api/company/get",
                   dataType: "json"
               },
               destroy: {
                   url: "/api/company/delete",
                   dataType: "json"
               },
               parameterMap: function(options, operation) {
                   if (operation !== "read" && options.models) {
                       return {models: kendo.stringify(options.models[0].id)};
                   }
               }
           },
           batch: true,
           pageSize: 20,
           schema: {
               model: {
                   id: "id",
                   fields: {
                       id: { type: "number" },
                       name: { type: "string" },
                       admin_id: { type: "number" },
                       address_id: { type: "number" },
                       status_msg: { type: "string" }
                   }
               }
           }
       });
});
 
ian
Top achievements
Rank 1
 answered on 21 Aug 2014
1 answer
257 views
Hi Guys,

I need you help on the problem that I'm encountering right now. I'm using Kendo I grid with Hierarchy and I have two date picker and button which is not part of the Grid (Please refer to the attachment grid.png). What I want to do is, when the "Update Date" button is clicked, the Period Start and Period End dates will be updated by what ever is selected in the datepicker outside the grid. All the data of all the child is more than 1,000 records. My current code is working, I was able to update all the data of all the child grid. The only problem is, the internet browser is not respoding due to a long running script. I expecting this process to be quick since I'm just only updating the data locally. Do you know a work around for this? Please see my code implementation below.

Grid initialization:

01.var grid = $("#gridJobsH");
02. 
03.grid.kendoGrid({
04.    dataSource: dataSource
05.    , columns: [               
06.        { field: 'HasSAPAccrualsTop', title: " ", template: '<span class="AccrualStatus-#= HasSAPAccrualsTop #"></span>', width: 50, filterable:false, sortable: false}            
07.        ,{ field: 'CommitmentCode', title: 'Purchase Order'}
08.        ,{ field: 'CommitmentSeller', title: 'Subcontractor'}                  
09.    ]
10.    , sortable: true
11.    , reorderable: true
12.    , groupable: false
13.    , filterable: true
14.    , columnMenu: true
15.    , selectable: false
16.    , pageable: false
17.    , resizable: true
18.    , scrollable: {
19.        virtual: true
20.    }
21.    , detailInit: detailInit
22.    , toolbar: [
23.        { template: kendo.template($("#gridJobsHToolbarTemplate").html()) }
24.     ]
25.});

Detail Grid:

01.//Detail grid
02.function detailInit(e) {
03.    $('<div class="hdChildGrid"></div>').appendTo(e.detailCell).kendoGrid({
04.        dataSource: {
05.            data: gridDetails
06.            , autoSync: false
07.            , schema: {
08.                model: {
09.                    id: "PhaseCode"
10.                    ,fields: {                             
11.                        HasSAPAccruals:{ editable: false }
12.                        ,PhaseCode: { editable: false }
13.                        ,Description: { editable: false }
14.                        ,PeriodStart: { editable: true, type: "date" }
15.                        ,PeriodEnd: { editable: true, type: "date" }
16.                        ,CommittedCost: { editable: false }
17.                        ,TotalCostActual: { editable: false }
18.                        ,Accruals: { editable: false }
19.                        ,Incurred: { editable: false, type: "number"  }
20.                        ,CurrentSAPValue: { type: "number" }
21.                        ,SAPAccrualValue: { type: "number"  }
22.                    }
23.                }
24.            }
25.            , filter: { field: "CommitmentCode", operator: "eq", value: e.data.CommitmentCode }
26.        }
27.        , columns: [   
28.            { field: 'HasSAPAccruals', title: " ", template: '<span class="AccrualStatus-#= HasSAPAccruals #"></span>', width: 50, filterable:false, sortable: false, locked: true, lockable: false}
29.            ,{ field: "PhaseCode", title: "Phase Code",  width: 150, locked: true, lockable: false }
30.            ,{ field: "Description", title: "Description", width: 150 }
31.            ,{ field: "PeriodStart", title: "Period Start", width: 150, format:"{0:MM-dd-yyyy}"}
32.            ,{ field: "PeriodEnd", title: "Period End", width: 150, format:"{0:MM-dd-yyyy}"}
33.            ,{ field: "CommittedCost", title: "PO Value", width: 110, type: "number", format: "{0:c}" }
34.            ,{ field: "TotalCostActual", title: "Expenditures", width: 130, type: "number" , format: "{0:c}"}
35.            ,{ field: "Accruals", title: "Accruals", width: 100, type: "number" , format: "{0:c}" }
36.            ,{ field: "Incurred", title: "Incurred", width: 100, format: "{0:c}" }
37.            ,{ field: "CurrentSAPValue", title: "Current SAP Value", width: 170, format: "{0:c}"}
38.            ,{
39.                field: "SAPAccrualValue"
40.                ,title: "SAP Accrual Value"
41.                ,width: 170
42.                ,format: "{0:c}"
43.                ,lockable: false
44.                ,editor: function(cont, options) {
45.                    var amt;
46.                     
47.                    kendo.culture("en-US");
48.                    amt = kendo.toString(options.model.CurrentSAPValue, "c");
49.                     
50.                    $("<span>" + amt + "</span>").appendTo(cont);
51.                }
52.            }
53.        ]
54.        , scrollable: true
55.        , sortable: true
56.        , filterable: true
57.        , columnMenu: true 
58.        , editable: true
59.        , resizable: true
60.        , selectable: "multiple"
61.        , save: function(d) {
62.            if (d.values.CurrentSAPValue) {
63.                d.model.set("SAPAccrualValue", d.model.Incurred - d.values.CurrentSAPValue);
64.                d.model.set('Dirty',true);
65.            }          
66.        }
67.    });
68.}

Button event:

01.var btnUpdateDate = $('#btnUpdateAllDate')
02.    ,infoDialog = $('#infoDialog')
03.    ,btnInfoOK = $("#btnInfoOK").data("kendoButton")
04.    ,infoDialogMsg = $('#infoDialogMsg');  
05.     
06.start = $("#StartDate").kendoDatePicker({value: new Date()}).data("kendoDatePicker");
07. 
08.end = $("#EndDate").kendoDatePicker({value: new Date()}).data("kendoDatePicker");
09. 
10.btnUpdateDate.kendoButton({
11.    click: function(e) {
12.        var startDate = start.value()
13.            ,endDate = end.value()
14.            ,parentGrid = $('#gridJobsH').data("kendoGrid")
15.            ,child = $('.k-detail-row').find('td.k-detail-cell').find('div.k-grid').data("kendoGrid");             
16.             
17.        if(endDate < startDate ) {
18.            infoDialogMsg.html('End date must be ahead to Start date.');
19.            infoDialog.data("kendoWindow").open();
20.        } else {
21.         
22.            var chilEl = $('.hdChildGrid')
23.                ,childGrid = $(chilEl[0]).data('kendoGrid');                   
24.                 
25.            if(childGrid != null) {
26.                var dataSource = childGrid.dataSource;
27.                 
28.                dataSource.fetch(function() {
29.                    var models = dataSource.data()
30.                      ,modelsLength = models.length;
31. 
32.                    for (var i = 0; i < modelsLength; i++) {
33.                        var m = models[i];
34. 
35.                        m.set('PeriodStart', startDate);
36.                        m.set('PeriodEnd', endDate);
37.                    }                   
38.                });
39.            }
40.        }      
41.    }
42.});

Your idea is highly appreciated.

Thanks
Alexander Valchev
Telerik team
 answered on 21 Aug 2014
1 answer
215 views
Hi, when adding a Kendo button to a notification template, the generated <script> tags are overlapping and causing the notification window to fail.  Am I missing something or is this a bug?  I'm about to give up and try the Kendo window control.

HTML
<script id="reportTemplate" type="text/x-kendo-template">
    <div style="height:100px; width:300px;border:thin solid black;">
        <h3><img src="/Content/Images/SuccessfulSaveTickMark.png" alt="" />#= title #</h3>
        <p>
            @Html.LabelFor(m => m.NotificationText)
        </p>
        <p>
            @(Html.Kendo().Button()
                .Name("viewNowButton")
                .HtmlAttributes(new { type = "button", onclick = "javascript:validateSession()" })
                .Content("View Now")
            )
            @(Html.Kendo().Button()
                .Name("viewLaterButton")
                        .HtmlAttributes(new { type = "button", onclick = "javascript:validateSession()" })
                .Content("View Later")
            )
            @(Html.Kendo().Button()
                .Name("downloadButton")
                        .HtmlAttributes(new { type = "button", onclick = "javascript:validateSession()" })
                .Content("Download")
            )
        </p>
        <p>
            @(Html.Kendo().Button()
                .Name("redirectToReportPickupButton")
                .HtmlAttributes(new { type = "button", onclick = "javascript:validateSession()" })
                .Content("Go to Report Pick Up Page")
            )
        </p>
    </div>
</script>


Output
​
<script id="reportTemplate" type="text/x-kendo-template">
    <div style="height:100px; width:300px;border:thin solid black;">
        <h3><img src="/Content/Images/SuccessfulSaveTickMark.png" alt="" />#= title #</h3>
        <p>
            <label for="NotificationText">NotificationText</label>
        </p>
        <p>
            <button id="viewNowButton" onclick="javascript:validateSession()" type="button">View Now</button><script>
    jQuery(function(){jQuery("#viewNowButton").kendoButton({});});
</script>
            <button id="viewLaterButton" onclick="javascript:validateSession()" type="button">View Later</button><script>
    jQuery(function(){jQuery("#viewLaterButton").kendoButton({});});
</script>
            <button id="downloadButton" onclick="javascript:validateSession()" type="button">Download</button><script>
    jQuery(function(){jQuery("#downloadButton").kendoButton({});});
</script>
        </p>
        <p>
            <button id="redirectToReportPickupButton" onclick="javascript:validateSession()" type="button">Go to Report Pick Up Page</button><script>
    jQuery(function(){jQuery("#redirectToReportPickupButton").kendoButton({});});
</script>
        </p>
    </div>
</script>
Dimo
Telerik team
 answered on 21 Aug 2014
7 answers
1.3K+ views
I have a graph in Kendo with positive values. The problem is that the Y-axes takes his range in function of the values.E.g. minimum value is 5000 -> the y-axis starts from 4500.Is there a way to get the y-axis fixed on 0? So it always starts from 0 instead of a narrower range. I found that you can put the min on 0 in ValuesAxis, but the problem here is that I can't get any negative values in this way.

My code:
$scope.line = {<br>        cache:false,<br>        legend: {<br>            visible: false<br>        },<br>        title: {<br>            text: "Last 10"<br>        },<br>        series: [{<br>            type: "line",<br>            style: "smooth",<br>            field: "OBAmount",<br>            categoryField: "date",<br>            color: '#0c50dd'<br>        }],<br>        valueAxis: {<br>            line: {<br>                visible: false<br>            }<br>        },<br>        tooltip: {<br>            visible: true,<br>            template: "#= kendo.format('{0:n2}', value) # "<br>        }<br>    }
T. Tsonev
Telerik team
 answered on 21 Aug 2014
1 answer
736 views
I want the following behaviour of the grid height like in this Fiddle: http://jsfiddle.net/dimodi/SDFsz/
but then also calculate the maximal possible rows on the screen without showing the scrollbar everythime the user changes the browser height. So our users can easily go with pageUp and pageDown through the gird.

And change the first value on the pageSize dropdown to 'Fit'.

Is it possible to make a directive in AngularJS that can do this behaviour?
Dimo
Telerik team
 answered on 21 Aug 2014
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
Application
Drag and Drop
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?