Telerik Forums
Kendo UI for jQuery Forum
13 answers
1.8K+ views

Hi 

I get some problem when I try to delete a record in Grid. They method will call the create and update method which is I don't want.

Please refer to pic1, my grid is batch update, I have one record in , then click Add new record button to add two new records but not save into database yet. At this moment, there are three records in grid, then I click the delete button on the third row, it will trigger the create method to transfer the two new records to the backend, this is I don't want, because I have not typed any value, it will get error in my backend.

So my question is there any way to ignore the create, update method when I click the delete button?

Below is the method of my custom Delete button.

function onDeleteConfirm_VendorSalesRepsGrid(e, obj) {
    e.preventDefault();
    var dataItem = obj.dataItem($(e.target).closest("tr"));
    CustomConfirmDialog("Are you sure you want to delete this Vendor Sales Reps?", function test2(result) {
        if (result === true) {
            var dataSource = $("#VendorSalesRepsGrid").data("kendoGrid").dataSource;
            dataSource.remove(dataItem);
            //If the id equal to 0, it means that this record does not existed in database. so no need to run the sync().
            if (dataItem.id != 0) {
                dataSource.sync();
            }            
        }
    });
}

 

Stefan
Telerik team
 answered on 02 May 2017
3 answers
348 views

Hi,

Facing issue with TreeView with  angular1. PSB code.

Problem: When i try to model my JSON for Checkbox Tree doesn't bind my attribute named "children" may be because the property name same!

Expected: As we change kendo default "text" property to custom "dataTextField", How can i replace "items" to "children"

 

HTML:

<div kendo-tree-view="tree"  k-data-source="dataSource"   k-options="options"   k-on-change="selecteditem=dataItem"> </div>

 

Angular:

 var schemaTree = {
        model: {
          //children: "items"
            children: "children"
          }
        };

        $scope.options = {
         dataTextField: "name",
          
          checkboxes: {
            checkChildren: true,
            template: "<input id='checkbox_#:item.uid#' ng-model='dataItem.isChecked' type='checkbox' class='k-checkbox'/><label for='checkbox_#:item.uid#' class='k-checkbox-label'></label>"
          },
          
          template: "#: item.name #"
        };

        $scope.treeData = [
          {
            "name": "Alex's family tree",
            "isChecked":true,
            "id": 44,
            "items": [
              {
                "id": 1,
                "name": "Reef",
                "isChecked": true
              },
              {
                "id": 2,
                "name": "Coraline",
                "isChecked": true
              }
            ],
            "children": [
              {
                "id": 1,
                "name": "Reef",
                "isChecked": true
              },
              {
                "id": 2,
                "name": "Coraline",
                "isChecked": true
              }
            ]
          }
        ];
        
        $scope.dataSource = new kendo.data.HierarchicalDataSource({
        data : $scope.treeData,
          schema: schemaTree
        });

 

Please let me know if you need more info on the same. Any help will be appreciated.

 

Regards,

Harish

Veselin Tsvetanov
Telerik team
 answered on 02 May 2017
2 answers
120 views

Hi, is there any way to filter rows in the spreadsheet by cell colour? Excel has this functionality - its called "Filter by Color or Filter Cell by color"

Thanks

Marc

Marc
Top achievements
Rank 1
 answered on 02 May 2017
1 answer
575 views

Hi,

 

I'm trying to figure out how to display the category name for each data series on a column chart (I'm trying to get to something like the attached picture).

For now I'm just hard coding up an example in an html template. and so far I have the following:

<kendo-chart [categoryAxis]="{ categories: ['Assets', 'Liabilities']}">
    <kendo-chart-title text="Balance Sheet" font="22pt Segoe UI">
    </kendo-chart-title>
    <kendo-chart-series-defaults type="column" [labels]="{ visible: true }">
    </kendo-chart-series-defaults>
    <kendo-chart-legend [visible]="false"></kendo-chart-legend>
 
 
    <kendo-chart-series>
        <kendo-chart-series-item [stack]="true" [gap]="0.5" [data]="[60000, 0]" [name]="'Current Assets'">
        </kendo-chart-series-item>
        <kendo-chart-series-item  [name]="'Capital & Reserves'" [data]="[0, 20000]">
        </kendo-chart-series-item>
        <kendo-chart-series-item  [name]="'Current Liabilities'" [data]="[0, 40000]" >
        </kendo-chart-series-item>
    </kendo-chart-series>
</kendo-chart>

 

Looking at the docs (SeriesLabel) I think I can add more to the labels json object I'm configuring on line 4. But I'm struggling to get the syntax correct.

Does anyone have any suggestions?

 

Daniel
Telerik team
 answered on 02 May 2017
5 answers
174 views

Can you look this example http://dojo.telerik.com/ebAkU/5.

When i use "editRow" method first time - all work good. But the second call "editRow" kendo grid do nothing. 

Did i do something wrong? Or it is a grid bug?

Dimiter Topalov
Telerik team
 answered on 01 May 2017
1 answer
710 views

I have a method which takes some data from the datasource and via a RESTful webservice, changes it. I then need to update the datasource items.

I am using AngularJS so I have tried updating the $scope variable which is used inside the read method of my datasource ie (in the below example I changed $scope.myLocalResults

read: function (options) {
    options.success($scope.myLocalResults);
}

And then called datasource.read() - however this turned out to be quite slow.

I have then tried just updating the changed records - ie my webservice returns an array of records (order guaranteed so I find the originally index of the record from $scope.myLocalResults, and then do:

var dataItem = dataSource.at(index);
dataSource.remove(dataItem);
dataSource.insert(index, myNewRecord);

 

However this is also quite slow - around 1 second per record, and I have around 2000 records.

Is there a quicker way to achieve what I want to do? I cannot simply using the .set method of the dataItem, as we have around 200 columns which could change.

Also - does .remove and .insert on the dataItem cause any datasource method to be fired, ie read or sync or something like that? I'm trying to work out why this is so slow, in comparison to other operations I am doing to the JS objects.

Thanks

Marc

Veselin Tsvetanov
Telerik team
 answered on 01 May 2017
1 answer
142 views

Good afternoon,

I am trying to implement some custom behaviour in a Scheduler during a move operation.

I am binding to the moveEnd event, and the API is very helpfully providing the destination slot and the resources associated with that slot. So far, so good. But I also require the origin slot and the resources associated with it. The moveEnd event does not provide this information. The moveStart event does not provide any information about slots or resources at all. My grouping resource allows multiple values, so I can't determine by looking at the event itself which of its several resources corresponds to the slot that was clicked at the start of the drag. How can I determine this information?

Plamen
Telerik team
 answered on 01 May 2017
4 answers
295 views

Hi, 

I have a aspgrid for which i am applying kendo grid ui. There are 2 columns in the grid, 1. BoundField 2. TemplateField in which i want to show KendoEditor control.

But KendoEditor UI is applied to only first row. I am expecting this will get applied to all the rows.

I have attached my aspx and aspx.cs code snapshots. 

 

Dharmavaram
Top achievements
Rank 1
 answered on 01 May 2017
2 answers
509 views

Dear Team ,

Here is a dojo where I have a simple scroll view working fine

Basic Scroll View Working Fine :http://dojo.telerik.com/OfUbI

When I use the scroll view along with a tabstrip ,the scroll does not work, it does not even show the pager

Scroll Not working with tabstrip : http://dojo.telerik.com/uDeZO/3

Another Issue I have is that when I have multiple images of different sizes in the scroll-view the scroll-view takes the height of the largest image.

Is there any way that this can be made dynamic such that the pager appears directly below the image with small size without leaving blank space in between ?

Or can the smaller images be automatically resized to fit the height of the largest image of the scroll view

Here is the sample for the same : Scroll with different size images

 

devApps
Top achievements
Rank 1
 answered on 30 Apr 2017
7 answers
414 views

I have my views for the kendo scheduler set up like so:

views: [

    {type: "day", startTime: new Date(1901, 1, 1, 0, 0, 0), endTime: new Date(1901, 1, 1, 23, 59, 59), workDayStart: new Date(workHoursStart), workDayEnd: new          Date(workHoursEnd)},

    {type: "week", startTime: new Date(1901, 1, 1, 0, 0, 0), endTime: new Date(1901, 1, 1, 23, 59, 59), workDayStart: new                                                                          Date(workHoursStart), workDayEnd: new Date(workHoursEnd), selected: true},

    {type: "workWeek", startTime: new Date(1901, 1, 1, 0, 0, 0), endTime: new Date(1901, 1, 1, 23, 59, 59), workDayStart: new Date(workHoursStart),                            workDayEnd: new Date(workHoursEnd)},{type: "month"},

    {type: "agenda", eventTemplate: $('#agendaEventTemplate').html()},

    {type: AgendaDayView, title: 'Day Agenda', eventTemplate: $('#agendaEventTemplate').html()},

    {type: "timeline", columnWidth: 1, minorTickCount: 1, startTime: new Date(1901, 1, 1, 0, 0, 0), endTime: new Date(1901, 1, 1, 23, 59, 59), workDayStart: new            Date(workHoursStart), workDayEnd: new Date(workHoursEnd), group: {orientation: 'vertical', resources: ['OwnerName']}},

    {type: "timelineWeek", minorTickCount: 1, majorTick: 1440, columnWidth: 1, startTime: new Date(1901, 1, 1, 0, 0, 0), endTime: new Date(1901, 1, 1, 23, 59,              59), workDayStart: new Date(workHoursStart), workDayEnd: new Date(workHoursEnd), group: {orientation: 'vertical', resources: ['OwnerName']}},

    {type: "timelineMonth", startTime: new Date(1901, 1, 1, 0, 0, 0), endTime: new Date(1901, 1, 1, 0, 0, 0), group: {orientation: 'vertical', resources:                                 ['OwnerName']}}],

with no declaration of workDayStart and workDayEnd in the scheduler initialization outside of each view declaration, because timelineMonth and timelineWeek throw an error when switching to show work hours. Doing what I did above and getting rid of setting workDayStart and workDayEnd as an option in the scheduler fixed the timelineMonth error, but the timelineWeek error is still there... I am wondering if anyone knows how I show work hours in the timelineWeek view. Can timelineWeek view even handle show work hours? Or is it not supposed to? (like timelineMonth)

The error I get is: 'Uncaught TypeError: Cannot read property "end" of undefined' when switching to work hours in timelineWeek view.

Sayer
Top achievements
Rank 1
 answered on 28 Apr 2017
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?