Telerik Forums
Kendo UI for jQuery Forum
1 answer
1.3K+ views
I want to open kendo grid in window. I am not passing any values to the window. When Opening the window, I want to read data from database and populate the grid. Can I use Partial View for the Grid and Load in Kendo Window ? If so, How can I do this ?
Kiril Nikolov
Telerik team
 answered on 03 Mar 2015
1 answer
1.2K+ views
I am trying to show the EditDetail button only if Submit Date is NULL. But editButton.hide() is not working. Below is my code. I wonder what is wrong or what other way can meet my need. Any help would be highly appreciated. Thanks,

@(Html.Kendo().Grid(Model)
                .Name("grid")
                .Columns(columns =>
                {
                    columns.Command(command => command.Custom("EditDetails").Text("Edit Details").Click("EditDetails"));
                    columns.Bound(p => p.CompanyName);
                    columns.Bound(p => p.Qrt).Title("Quarter").Format("{0:d}");
                    columns.Bound(p => p.SubmitDate).Format("{0:d}");//.Width(375);
                    columns.Bound(p => p.CreateBy).Title("Created By");
                    columns.Bound(p => p.CreateDate).Format("{0:d}").Title("Imported By");
                    columns.Bound(p => p.ReportID).Hidden();

                })

                .Events(e=>e.DataBound("onDataBound"))
                .Pageable()
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Model(model1 =>
                        {
                            model1.Id(p1 => p1.ReportID);
                       })
                    .ServerOperation(false)
                    .Read(read => read.Action("UnitRptGrid_Read", "Report"))
                    .PageSize(50)
                )
)

<script type="text/javascript">
    function EditDetails(e) {
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        window.location.href = "/Reports/Edit/" + dataItem.id; 
    }

    function onDataBound(e) {
        var grid = $("#grid").data("kendoGrid");
        var view = grid.dataSource.view();

        $.each(view, function (i, row) {
            var chk = row.SubmitDate;
            if (null == chk)
            { 
                //var editButton = row.find(".k-grid-edit");
                var b = $('tr[data-uid="' + row.uid + '"] td:nth-child(1)')
                var editButton = $b.find("k-button k-button-icontext k-grid-EditDetails")
                editButton.hide();
               
            }
        })
    }
</script>     
Rosen
Telerik team
 answered on 03 Mar 2015
1 answer
173 views
I am using a kendo-ui grid together with angular and would like to use it's edit functionality. However the update function is never called when trying to edit its contents.

This is how I set the grid:

angular.module("KendoDemos", [ "kendo.directives" ])
        .controller("MyCtrl", function($scope){
            $scope.mainGridOptions = {
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Employees",
                          update: function(options){
                          console.log("updated");
                        }
                    }
                },
                  editable: "inline",
                columns: [{
                    field: "FirstName",
                    title: "First Name",
                    width: "120px"
                    },{
                    field: "LastName",
                    title: "Last Name",
                    width: "120px"
                    },{
                    field: "Country",
                    width: "120px"
                    },{
                    field: "City",
                    width: "120px"
                    },{
                      command: ["edit", "destroy"],
                      title: " ",
                      width: "250px"
                    }]
            };
 
        })


Here is a fiddle to demonstrate it: http://jsfiddle.net/xLp6rLtj/

Even if I'm using a url instead of function in the `datasource.transport.update` parameter, no request is made (and the button can't be released).

What am I missing?

 
⇄
English (Auto-Erkennung) » German
 
Patrick
Top achievements
Rank 1
 answered on 03 Mar 2015
6 answers
392 views

Hi,

I'm getting a strange behavior in a grid after update to the latest 2014.3.1316 version in some header elements where values of "data-field" attribute mismatched the expected value however the title and the rest of attributes are correct. As I have described it in the title this occurs when I arrange the column's configuration array for multicolumns mode but not if I use single column headers.

After a while debugging, I've found that headers are well generated and fields are synchronized before binding the view and the model. Just after returning from the bind function is when headers change incorrectly.

The grid is defined inside a template file and it is compile as follow:

    <div id="product-grid4"
        class="product_grid_widget"
        data-role="grid"
        data-auto-bind="false"
        data-sortable="true"
        data-pageable="false"
        data-filterable="{ extra: false }"
        data-bind="source: products.dataSource"
        data-editable="false"
        data-selectable="true"
        data-resizable="true"
        data-scrollable="true"
        data-reorderable="false"
        data-columns='[{
    "field" : "_SELECTED_",
    "type" : "integer",
    "filterable" : false,
    "title" : "",
    "width" : 29,
    "headerTemplate" : "",
    "template" : "<div id=\"#=Order_Code#\" class=\"grid-selection-column-box#if(_SELECTED_>-1){# #=WE.selectionColumnTemplate(Order_Code)##}#\"><div class=\"checkmark\"></div></div>",
    "attributes" : {
        "class" : "checkmark"
    }
}, {
    "field" : "Series",
    "type" : "string",
    "title" : "Series",
    "width" : 85,
    "filterable" : true
},  ...

(The complete text is attached)

As I mentioned. Before binding, the header elements are correctly defined:

<th class="k-header" role="columnheader" rowspan="2" data-field="_SELECTED_" data-role="columnsorter" data-index="0">
    <a class="k-link" href="#"/>
</th>
<th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Series" data-role="columnsorter" data-index="1" data-title="Series">
    <a tabindex="-1" class="k-grid-filter" href="#">
        <span class="k-icon k-filter"/>
    </a><a class="k-link" href="#">Series</a>
</th>
<th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Order_Code" data-role="columnsorter" data-index="2" data-title="Order Code">
    <a tabindex="-1" class="k-grid-filter" href="#">
        <span class="k-icon k-filter"/>
    </a><a class="k-link" href="#">Order Code</a>
</th>
<th class="k-header" role="columnheader" rowspan="2" data-field="Datasheet" data-index="3" data-title="Spec">Spec</th>
<th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Type" data-role="columnsorter" data-index="4" data-title="Type">
    <a tabindex="-1" class="k-grid-filter" href="#">
        <span class="k-icon k-filter"/>
    </a><a class="k-link" href="#">Type</a>
</th>
<th class="k-header" role="columnheader" colspan="6" data-field="" data-title="Electrical Properties" data-colspan="6">Electrical Properties</th>
<th class="k-header" role="columnheader" colspan="5" data-field="" data-title="Dimensions" data-colspan="5">Dimensions</th>
<th class="k-header" role="columnheader" colspan="3" data-field="" data-title="Temperature" data-colspan="3">Temperature</th>
<th class="k-header" role="columnheader" colspan="4" data-field="" data-title="Construction" data-colspan="4">Construction</th>
 
However after binding, this what happens:

<th class="k-header" role="columnheader" rowspan="2" data-field="_SELECTED_" data-role="columnsorter" data-index="0">
    <a class="k-link" href="#"/>
</th>
<th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Order_Code" data-role="columnsorter" data-index="1" data-title="Series">
    <a tabindex="-1" class="k-grid-filter" href="#">
        <span class="k-icon k-filter"/>
    </a><a class="k-link" href="#">Series</a>
</th>
<th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Type" data-role="columnsorter" data-index="2" data-title="Order Code">
    <a tabindex="-1" class="k-grid-filter" href="#">
        <span class="k-icon k-filter"/>
    </a><a class="k-link" href="#">Order Code</a>
</th>
<th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Temperature_Warming" data-role="columnsorter" data-index="3" data-title="Spec">
    <a tabindex="-1" class="k-grid-filter" href="#">
        <span class="k-icon k-filter"/>
    </a><a class="k-link" href="#">Spec</a>
</th>
<th class="k-header k-with-icon k-filterable" role="columnheader" rowspan="2" data-field="Rated_Current" data-role="columnsorter" data-index="4" data-title="Type">
    <a tabindex="-1" class="k-grid-filter" href="#">
        <span class="k-icon k-filter"/>
    </a><a class="k-link" href="#">Type</a>
</th>
<th class="k-header" role="columnheader" colspan="6" data-field="" data-index="5" data-title="Electrical Properties" data-colspan="6">Electrical Properties</th>
<th class="k-header" role="columnheader" colspan="5" data-field="" data-index="6" data-title="Dimensions" data-colspan="5">Dimensions</th>
<th class="k-header" role="columnheader" colspan="3" data-field="" data-index="7" data-title="Temperature" data-colspan="3">Temperature</th>
<th class="k-header" role="columnheader" colspan="4" data-field="" data-index="8" data-title="Construction" data-colspan="4">Construction</th>

Of course, this cause many unexpected problems when filter or show/hide columns.

I chose to avoid the multicolumn by the moment because I has not been able to found a solution.

Thanks so much.



Rosen
Telerik team
 answered on 03 Mar 2015
1 answer
371 views
Q1: I need to have several custom buttons in the toolbar that will perform various actions such as "Insert Child", "Insert Sibling", "Edit", "Delete". The buttons should also be enabled/disabled based on node selection. How can I achieve this using the MVC extensions?

Q2: Also, does the TreeList support drag and drop? I want to be able to capture the drag/drop to reorder by tree nodes. If not, I would add "Move Up" and "Move Down" custom buttons.

Thanks,
--John
Alexander Popov
Telerik team
 answered on 03 Mar 2015
1 answer
173 views
Suggestion:

When you have a Grid with paging (client paging) and you change the page using the navigation control requestEnd event from dataSource is raised and the e parameter return with e.status, e.type undefined. That is, return a complete different variable.

For consistence maybe is better that the e parameters e.status and e.type continues to be defined with a value that identified the operation..

Thanks

Rosen
Telerik team
 answered on 03 Mar 2015
5 answers
1.0K+ views
Hi,
  
      Is there any components  Histogram and Trend charts. If you have please let me know.

Regards
Raveendra
T. Tsonev
Telerik team
 answered on 03 Mar 2015
3 answers
187 views
Hi,
 
   I just downloaded and gone through few of the demos. Its nice to see scattered jquery siblings at one place. I know its still under beta stages, but am wondering if you would be able to inform me the support for TreeMap and HeatMaps in near future? How long it may take?
T. Tsonev
Telerik team
 answered on 03 Mar 2015
3 answers
503 views
Hi,

I have the following case:

I send batch records to server. Some of them get updated and others don't.

For the successfully updated rows, I want to commit changes on data source so that "dirty" is false.

While the others with errors, I will show the errors on Grid.

The problem is, can I update "dirty" for specific records? Also, is it enough to update this property to let data source know that the record updated has no more changes and committed?

Thanks
Alexander Popov
Telerik team
 answered on 03 Mar 2015
5 answers
724 views
Hi,
I've written the following custom binder to enable/disable multiple input controls inside a div at once, instead of having to set the enabled/disabled binder on each and every control:

kendo.data.binders.toggleState = kendo.data.Binder.extend({
    refresh: function() {
        var that = this;
        var value = that.bindings["toggleState"].get(); // get value of binding from viewmodel
 
        if (value) { // true = enable
            $(that.element).find(':input').removeAttr('disabled');
        } else {
             $(that.element).find(':input').attr('disabled', 'disabled');
        }
    }
});

The above works fine on all "HTML" controls, not Kendo UI widgets (dropdownlist, etc.).

Would it be possible to write a single custom binder that can work fine with both widgets and normal html controls?

Best regards
Bilal Haidar
Petyo
Telerik team
 answered on 03 Mar 2015
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
Map
Drag and Drop
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?