Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.3K+ views
Can i export grid with image in excel
Nikolay
Telerik team
 answered on 11 Nov 2016
5 answers
280 views

After downloading KendoUI v 2016.3.914, I noticed that the way the AMD dependencies are defined has changed since previous versions (I'm working off of v2015.3.1111 for reference). In the newer versions of KendoUI, each component appears to define all of the common functionality it will need in separate AMD definition blocks. For instance, dataviz.barcode.js now has sections for "util/main", "util/text-metrics", "util/base64", "mixins/observers", and the actual "kendo.dataviz.barcode" component. In v2015.3.1111 and before, there was only the block for "kendo.dataviz.barcode". This is the case for a number of components, many of which contain the exact same definitions for those common AMD definitions (for instance, util/main is defined in multiple files) which means that we are loading unnecessarily large files if we load multiple files with the same common dependencies. 

 

I realize that the reason for the change was to allow components to work more autonomously, but I was wondering if there is any distribution of the Kendo assets which behaves more like the older versions of Kendo and strip out the common AMD dependencies to core files, or to individual files per dependency? I know that the current versions contain files like kendo.all.js and kendo.web.js for common functionality, but I was hoping to avoid these larger files. Essentially, we want a similar setup to how v2015.3.1111 where all modules appear only once (i.e. we don't want to repeatedly see util/main in different files) with their dependencies. For our case, we dynamically combo-load kendo assets based on what a particular page of ours needs, so we need to understand the dependency tree prior to loading the page and don’t want to load duplicates.

Alex Hajigeorgieva
Telerik team
 answered on 11 Nov 2016
9 answers
846 views

Hi!

I was testing this demo:http://dojo.telerik.com/iVIja

I tried to set the clearButton to true/false - but there is not differnce in the output. (In both cases, there is no a clear button on the right side of the multiselect)

What's the problem?

thnx:Attila

Rumen
Telerik team
 answered on 11 Nov 2016
3 answers
198 views

I have a KendoUI Grid that is made up of several checkbox columns (screenshot attached). I'm having a problems getting the values to my controller. Below is the code I have for the grid. How do I pass checkbox values to my controller?

<div style="width: 1400px; clear: both;">        
        @(Html.Kendo().Grid<MVCTimesheetApplication.Models.REAP>()
            .Name("timesheetGrid")
            .TableHtmlAttributes(new { style = "table-layout: fixed; " })
            .Columns(columns =>
            {
                columns.Bound(t => t.Project).Title("Project").HtmlAttributes(new { style = "white-space: nowrap;" }).EditorTemplateName("ReadOnlyTemplate");
                columns.Bound(t => t.DisplayTask).Title("Task").HtmlAttributes(new { style = "white-space: nowrap;" }).EditorTemplateName("ReadOnlyTemplate");
                columns.Bound(t => t.IndirectId).EditorTemplateName("ReadOnlyTemplate");
                columns.Bound(t => t.State).Width(100).HtmlAttributes(new { style = "text-align: center;" }).EditorTemplateName("ReadOnlyTemplate");
                columns.Bound(t => t.Sunday).Width(75).HtmlAttributes(new { style = "text-align:center" }).ClientTemplate("<input type='checkbox' id='cbd#= Task #' />").Title(String.Format("Sun<br />{0}", ((DateTime)Session["startDate"]).ToString("M/d")));
                columns.Bound(t => t.Monday).Width(75).HtmlAttributes(new { style = "text-align:center" }).ClientTemplate("<input type='checkbox' id='cbd#= Task #' />").Title(String.Format("Mon<br />{0}", ((DateTime)Session["startDate"]).AddDays(1).ToString("M/d")));
                columns.Bound(t => t.Tuesday).Width(75).HtmlAttributes(new { style = "text-align:center" }).ClientTemplate("<input type='checkbox' id='cbd#= Task #' />").Title(String.Format("Tue<br />{0}", ((DateTime)Session["startDate"]).AddDays(2).ToString("M/d")));
                columns.Bound(t => t.Wednesday).Width(75).HtmlAttributes(new { style = "text-align:center" }).ClientTemplate("<input type='checkbox' id='cbd#= Task #' />").Title(String.Format("Wed<br />{0}", ((DateTime)Session["startDate"]).AddDays(3).ToString("M/d")));
                columns.Bound(t => t.Thursday).Width(75).HtmlAttributes(new { style = "text-align:center" }).ClientTemplate("<input type='checkbox' id='cbd#= Task #' />").Title(String.Format("Thu<br />{0}", ((DateTime)Session["startDate"]).AddDays(4).ToString("M/d")));
                columns.Bound(t => t.Friday).Width(75).HtmlAttributes(new { style = "text-align:center" }).ClientTemplate("<input type='checkbox' id='cbd#= Task #' />").Title(String.Format("Fri<br />{0}", ((DateTime)Session["startDate"]).AddDays(5).ToString("M/d")));
                columns.Bound(t => t.Saturday).Width(75).HtmlAttributes(new { style = "text-align:center" }).ClientTemplate("<input type='checkbox' id='cbd#= Task #' />").Title(String.Format("Sat<br />{0}", ((DateTime)Session["startDate"]).AddDays(6).ToString("M/d")));
                columns.Bound(t => t.TotalHours).Width(75).EditorTemplateName("GridDecimal").Title("Hours").HtmlAttributes(new { style = "white-space: nowrap;text-align:center;" });
            })
            .Navigatable()
            .Editable(editable =>
            {
                editable.DisplayDeleteConfirmation(false);
                editable.Mode(GridEditMode.InCell);
            })
            .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .ServerOperation(false)
                //.Events(events => events.Error("timesheetGrid_error_handler"))
                //.Events(events => events.RequestEnd("timesheetGrid_requestEnd"))
                .Model(model => model.Id(t => t.RowID))
                .Read(read => read.Action("REAP_Read", "Home"))
                .Update(update => update.Action("REAP_Update", "Home"))
            )
        .Events(events => events.DataBound("updateColumnTitles"))
        )
    </div>

Here is my model code...

public class REAP
    {
        [Key]
        public int RowID { get; set; }
        public string TimesheetID { get; set; }        
        public string Project { get; set; }
        public string DisplayProject { get; set; }
        public string Task { get; set; }
        public string DisplayTask { get; set; }
        public string IndirectId { get; set; }
        public string EarningsCodeId { get; set; }
        public string CostCategoryId { get; set; }
        public string State { get; set; }
        public bool Sunday { get; set; }
        public bool Monday { get; set; }
        public bool Tuesday { get; set; }
        public bool Wednesday { get; set; }
        public bool Thursday { get; set; }
        public bool Friday { get; set; }
        public bool Saturday { get; set; }
        public decimal TotalHours { get; set; }        
    }

And the code in my controller...

public ActionResult REAP_Update([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<REAP> reap)
        {
            string userID = Session["UserID"].ToString();
            string timesheetID = Session["TimesheetID"].ToString();
            int retCode = 0;            

            if (reap != null)
            {
                string INSERT_QUERY_NEW = "INSERT INTO RCS_TIME_SHEET_REAP (TIME_SHEET_ID, WEEK_ENDING, PROJECT, TASK, INDIRECT_ID, STATE, SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY) " +
                                          "VALUES (@timesheetID, @weekEnding, @project, @task, @indirectID, @state, @sunday, @monday, @tuesday, @wednesday, @thursday, @friday, @saturday);";            

                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["VTAConnectionString"].ConnectionString))
                {
                    SqlCommand cmd = new SqlCommand(INSERT_QUERY_NEW, conn);
                    CreateREAPParameters(cmd);

                    conn.Open(); 

                    foreach (var row in reap)
                    {
                        try
                        {
                            cmd.Parameters["@timesheetID"].Value = timesheetID;
                            cmd.Parameters["@weekEnding"].Value = "11/5/2016";
                            cmd.Parameters["@project"].Value = row.Project;
                            cmd.Parameters["@task"].Value = row.Task ?? "";
                            cmd.Parameters["@indirectID"].Value = row.IndirectId ?? "";
                            cmd.Parameters["@state"].Value = row.State ?? "";
                            cmd.Parameters["@sunday"].Value = row.Sunday;
                            cmd.Parameters["@monday"].Value = row.Monday;
                            cmd.Parameters["@tuesday"].Value = row.Tuesday;
                            cmd.Parameters["@wednesday"].Value = row.Wednesday;
                            cmd.Parameters["@thursday"].Value = row.Thursday;
                            cmd.Parameters["@friday"].Value = row.Friday;
                            cmd.Parameters["@saturday"].Value = row.Saturday;

                            cmd.ExecuteScalar();
                        }
                        catch(Exception ex)
                        {
                            string x = ex.Message;
                        }
                    }                  

                    conn.Close();
                }
            }

            return this.Json(new { retCode = retCode });
        }

Thanks

 

Danail Vasilev
Telerik team
 answered on 11 Nov 2016
1 answer
197 views

Hello,

I'm having the following problem with Kendo Angular Spreadsheet directive:

When I add two lines(2 and 3 for example) on the spreadsheet and then call dataSource.sync(), if line 2 returns an error from the server and the line 3 a success, and I call dataSource.sync() again, line 3 will be created again. When looking at the network calls, I can see that 2 POST requests are sent every time, even if one line was successfully created.

I made some research on this forum and found this post which describes a similar problem with a grid: http://www.telerik.com/forums/kendo-ui-grid-inserts-updates-create-duplicate-records#5qPMIWOM4UmWkpStr_17Ag

But I checked and my server returns the newly inserted item, but it seems that the dataSource does not update its internal data.

When I add 2 lines and the 2 POST requests return a success, the spreadsheet update correctly its internal data, and if I call dataSource.sync() again, no more POST requests will be made.

Thanks !

Stefan
Telerik team
 answered on 10 Nov 2016
14 answers
483 views

Hello, after much trial and error I've managed to remote bind my Grid to a Datasource and update it.  However, it appears it ONLY updates if I'm changing at least 2 cells in a row.  If I only change 1 cell, the update event does not fire.

I suspect the is either a Schema, Model or Data Binding issue.

$(kendoGrid).kendoGrid({
    dataSource: {
        transport: {
            read: {
                url: "Personnel/GetPersonnel",
                type: "GET",
                dataType: "json"
            },
            update: {
                url: "Personnel/PutPersonnel",
                type: "PUT",
                beforeSend: function (xhr, data) {
                    var json = JSON.parse(data.data);
                    data.url += '?=' + json.id;
                    xhr.setRequestHeader('id', json.id);
                },
                contentType: "application/json; charset=utf-8"
            },
            parameterMap:
                function (options, operation) {
                    if (operation !== "read") {
                        return JSON.stringify(options);
                    }
                }
        },
        schema: {
            data: "data",
            total: "total",
            model: {
            "id": "id",
          }
        },
        fields: {
          id: { "editable": false },
          employeeNumber: { "editable": false },
          loginName: { },
          firstName: { },
          middleName: { },
          lastName: { },
          site.name: { },
          state.stateName: { },
          isMechanic: { "editable": false },
          isDriver: { "editable": false }
        }
      }
});

Ryan
Top achievements
Rank 1
 answered on 10 Nov 2016
3 answers
429 views

Resize can be trigger on multiple events:

  • expand / collapse
  • user move splitbar
  • by window if splitter is inside window and window is resized

I need to act differently based on who trigger resize. There is expand/collapse events so this 2 events solve problems with first trigger. But what about second?

Basically I need to know if user move splitbar. How?

Vessy
Telerik team
 answered on 10 Nov 2016
4 answers
213 views

How can I hide bars and the space taken up by the bars if their values are null? In the chart shown in the following dojo Product Line 2 and Product Line 3 would be the same height and Product Line 1 would be twice their height. 

 

http://dojo.telerik.com/ANalE/4

InnisMaggiore
Top achievements
Rank 1
 answered on 10 Nov 2016
3 answers
273 views
I love the select behavior for a categoryAxis when clicking and dragging. On my page I want to use it as an interactive element to select multiple months on a bar graph. However the mousewheel behavior of the select interferes with scrolling up and down the page and I'd like to disable it, but. I found that the documentation supports categoryAxis.zoom.mousewheel as "left", "right", and "both", but has no option for "none". Is there some other way to disable the scroll behavior but keep the click and drag behaviors?
Iliana Dyankova
Telerik team
 answered on 10 Nov 2016
3 answers
156 views

I have a grid with a 'type' column.  The dataSource gives me the typeId which relates to data in another array.  Based on the type, I want to display a font-awesome image along with the type name.  I have the font-awesome class as a property of the object in the array.  Now, obviously, I can use the text and value properties in the array of type objects to set the label, but how can I add the third property of the classes?  

I currently have it hard-coded in the template as follows:

<div ng-if="dataItem.typeId == 0" class="text-center">
    <i class="fa fa-map-pin fa-2x red" aria-hidden="true"></i>
    <div class="bold">Reminder</div>
</div>
<div ng-if="dataItem.typeId == 1" class="text-center">
    <i class="fa fa-exclamation-circle fa-2x red" aria-hidden="true"></i>
    <div class="bold">Alert</div>
</div>
<div ....

However, that requires hard-coding the data values into the template instead of using what comes across in the data.  Is there a way to do something like this where type would be some kind of reference to the array of types?

<div ng-bind="dataItem.typeId" class="text-center">
    <i class="{{type.image}}" aria-hidden="true"></i>
    <div class="bold">{{type.text}}</div>
</div>

Thanks!

Stefan
Telerik team
 answered on 10 Nov 2016
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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?