Telerik Forums
Kendo UI for jQuery Forum
2 answers
242 views
Hello,

I have an issue when using two or more sortables with same container selector on one page. The problem appears when the width of one sortable differs from another (I use horizontal sortables). The second and others sortables take the sizes (in my case it is width) of the first, but it's wrong. I understand that changing the container's selector (select by id etc.) for each sortable will solve the problem, but in my case/project it's not possible, I had to leave the selector as it is (sortable is used in directive which can be reused several times on one page). 
Is there any way to workaround this issue not changing the selectors? 
Sample page can be found here http://dojo.telerik.com/@Artsem.Valenchyts@specific-group.by/axIKu (just try to drag the second sortable item).

Best Regards,
Artsem
Artsem
Top achievements
Rank 1
 answered on 06 Nov 2014
1 answer
1.2K+ views
I have a Kendo Grid with some "kendoDraggable()" methods on it. This allows me to drag/drop the rows (i.e. reordering rows).

It's based on this : http://jsfiddle.net/BtkCf/4/

The drag/drop of the rows works great, but it then almost completely disables the Edit/Update functions on the grid. That is, the Edit is buggy and won't let me access the cell's text content.

In my attached screen shots, I show the portion of the grid I'm trying to edit. I can click on the EDIT/UPDATE buttons, but CANNOT access the text. There's no error whatsoever.

How can I safely disable the kendoDraggable() events ?

I've tried this, but it doesn't work :

  
$('#userKriGrid tbody tr').off("click", '**');

and neither does this :

mainGrid.table.kendoDestroy()


HTML def:

<span id="userKriGrid" 
kendo-grid="vm.userKriGrid"
k-data-source="vm.kriUserGridDS"
k-options="vm.userKriGridOptions"
k-rebind="vm.userKriGridOptions">
</span>

and here's the function in my angular controller :

function addDragDropKRIGridRow() {
            var mainGrid = $("#userKriGrid").data("kendoGrid");
            var mainDataSource = vm.kriUserGridDS;
            var selectedClass = 'k-state-selected';
 
            $.fn.reverse = [].reverse;  //save a new function from Array.reverse
 
            $(document).on('click', '#userKriGrid tbody tr', function (e) {
                if (e.ctrlKey || e.metaKey) {
                    $(this).toggleClass(selectedClass);
                } else {
                    $(this).addClass(selectedClass).siblings().removeClass(selectedClass);
                }
            });
 
            mainGrid.table.kendoDraggable({
                filter: "tbody tr",
                group: "gridGroup",
                axis: "y",
                hint: function (item) {
                    var helper = $('<div class="k-grid k-widget drag-helper"/>');
                    if (!item.hasClass(selectedClass)) {
                        item.addClass(selectedClass).siblings().removeClass(selectedClass);
                    }
                    var elements = item.parent().children('.' + selectedClass).clone();
                    item.data('multidrag', elements).siblings('.' + selectedClass).remove();
  
                    return helper.append(elements);
                }
            });
            mainGrid.table.kendoDropTarget({
                group: "gridGroup",
                drop: function (e) {
 
                    var draggedRows = e.draggable.hint.find("tr");
                    e.draggable.hint.hide();
                    var dropLocation = $(document.elementFromPoint(e.clientX, e.clientY)),
                        dropGridRecord = mainDataSource.getByUid(dropLocation.parent().attr("data-uid"))
                    if (dropLocation.is("th")) {
                        return;
                    }
 
                    var beginningRangePosition = mainDataSource.indexOf(dropGridRecord),//beginning of the range of dropped row(s)
                        rangeLimit = mainDataSource.indexOf(mainDataSource.getByUid(draggedRows.first().attr("data-uid")));//start of the range of where the rows were dragged from
 
 
                    //if dragging up, get the end of the range instead of the start
                    if (rangeLimit > beginningRangePosition) {
                        draggedRows.reverse();//reverse the records so that as they are being placed, they come out in the correct order
                    }
 
                    //assign new spot in the main grid to each dragged row
                    draggedRows.each(function () {
                        var thisUid = $(this).attr("data-uid"),
                            itemToMove = mainDataSource.getByUid(thisUid);
                        mainDataSource.remove(itemToMove);
                        mainDataSource.insert(beginningRangePosition, itemToMove);
                    });
 
 
                    //set the main grid moved rows to be dirty
                    draggedRows.each(function () {
                        var thisUid = $(this).attr("data-uid");
                        mainDataSource.getByUid(thisUid).set("dirty", true);
                    });
 
                    //remark things as visibly dirty
                    var dirtyItems = $.grep(mainDataSource.view(), function (e) { return e.dirty === true; });
                    for (var a = 0; a < dirtyItems.length; a++) {
                        var thisItem = dirtyItems[a];
                        mainGrid.tbody.find("tr[data-uid='" + thisItem.get("uid") + "']").find("td:eq(0)").addClass("k-dirty-cell");
                        mainGrid.tbody.find("tr[data-uid='" + thisItem.get("uid") + "']").find("td:eq(0)").prepend('<span class="k-dirty"></span>')
                    };
                }
            });
        }


Alexander Valchev
Telerik team
 answered on 06 Nov 2014
2 answers
491 views
Dear Sir/Madam,

I have a problem with Kendo Upload as below:
1. Call aspx file
$("#filUpload").kendoUpload({
        async: {
            saveUrl: "/_QISSI/import/upload.aspx",
            removeUrl: "remove",
            autoUpload: true,
            success: fFile_onSuccess,
            multible: false
        }
    });

2. In Page_Load method, I saved the uploaded file but I don't how to set successful status for Kendo Upload.

Please give me some document relating to the problem.

Thanks and best regards,
Enzo
Top achievements
Rank 1
 answered on 06 Nov 2014
4 answers
1.4K+ views
I am using the upload widget on ASP.Net when I submit the form.  Due to the file size limit allowed by the server I need a way to cancel the submit if the combined size of the files selected for upload as above a set limit.  Any help is appreciated.

Wade
Dimo
Telerik team
 answered on 06 Nov 2014
3 answers
241 views
Hi there, my understanding with SEO is to stay away from JavaScript if at all possible for the content that needs to be indexed.  So naturally I'd imagine if everything is rendered on server side say via JSP then everything should be fine, and I should select Kendo UI JSP rather than Kendo UI (HTML) for this purpose.

However, reviewing either of the following pages with IE's Developer Tools I am able to see the content of the table displayed in proper HTML format.
http://demos.telerik.com/jsp-ui/grid/index
http://demos.telerik.com/kendo-ui/grid/index

So the question is does this mean in terms of SEO either Kendo UI or Kendo UI JSP makes no difference and I shouldn't be selecting one over the other based on this?
Sebastian
Telerik team
 answered on 06 Nov 2014
3 answers
147 views
Hi i have a chart where i have 3 series.

The first series should be the total value (all requests) and the other 2 should be stacked (accepted / rejected requests).
How is this possible?
I can only get it working that all 3 series are stacked but thats not my goal.

.SeriesDefaults(seriesDefaults =>
seriesDefaults.Area().Line(line => line.Style(ChartAreaStyle.Smooth))
)
.Series(series =>
{
series.Area(Model.Requests).Name("Total requests").Stack(false);
series.Area(Model.AcceptedRequests).Name("Accepted requests").Stack(true);
series.Area(Model.RejectedRequests).Name("Rejected requests").Stack(true);
})

why is this not working?
Hristo Germanov
Telerik team
 answered on 06 Nov 2014
1 answer
331 views
Hi
I’ve found a kind of weird behaviour that occurs during change a progress value directly on a gantt chart, when after it, end of date is also changing. I tried to debug this scenario, to exclude bug on my webservices side. But in the same controller i cannot see any what supposed to be wrong. In a tracing, values to be set in business logic was fine.

My model responsible for read/update looks like:

 public class GetTasksController : ApiController
    {        
        public IEnumerable<DCProdTask> Get()
        {
            Soneta.Business.App.Login t = WebApiApplication.EnovaLogin;

            using (Session sesja = t.CreateSession(true, false))
            {
                DritProdukcjaModule PM = DritProdukcjaModule.GetInstance(sesja);
                return PM.ProdTasks.CreateView()
                                 .Cast<ProdTask>()
                                 .Select(x => Mapper.Map<ProdTask, DCProdTask>(x));               
            }
        }
       
      
        public async Task<DCProdTask> Get([FromUri] ModelType value, string type)        
        {            
            IList<DCProdTask> persons = new System.Web.Script.Serialization.JavaScriptSerializer()
                .Deserialize<IList<DCProdTask>>(value.models);
            DCProdTask[] arr = persons.ToArray<DCProdTask>();
            DCProdTask task = arr[0];            
            Soneta.Business.App.Login l = WebApiApplication.EnovaLogin;
            List<ProdTask> list = new List<ProdTask>();
            switch (type)
            {
                case "Update":  using (Session sesja = l.CreateSession(false, false))
                    {
                        using (ITransaction t = sesja.Logout(true))
                        {
                            DritProdukcjaModule PM = DritProdukcjaModule.GetInstance(sesja);
                            Soneta.Business.View view = PM.ProdTasks.CreateView();
                            view.Condition &= new FieldCondition.Equal("ID", task.ID);
                            view.LoadingRowsCount = 1;
                            ProdTask PTask = (ProdTask)view.GetFirst();
                            if (PTask != null)
                            {
                                DateTime _start = Convert.ToDateTime(task.Start);
                                DateTime _end = Convert.ToDateTime(task.End);
                                Soneta.Types.Percent _percentComplete =
                                    new Soneta.Types.Percent(Convert.ToDecimal(task.PercentComplete));
                                PTask.DataOd = new Soneta.Types.Date(_start);
                                PTask.CzasOd = new Soneta.Types.Time(_start.Hour, _start.Minute);
                                PTask.DataDo = new Soneta.Types.Date(_end);
                                PTask.CzasDo = new Soneta.Types.Time(_end.Hour, _end.Minute);
                                PTask.PercentComplete = _percentComplete;
                                list.Add(PTask);
                            }
                            t.CommitUI();

                        }
                        sesja.Save();
                        sesja.InvokeChanged();
                    }
                    break;
                default: break;
            }
            return  Mapper.Map<ProdTask, DCProdTask>(list.ToArray<ProdTask>()[0]);                         
        }




I’ve attached a couple of screenshots to show a fake values providing to web service through the url, and response as JSON. What is curious, it only happen on a tasks with small data intervals between start and end. When i have huge gantt tasks and i change progress from Month view, i have not noticed such behaviour.


Dimitar Terziev
Telerik team
 answered on 06 Nov 2014
4 answers
430 views
Iam tring to create custom toolbar for my grid, tried few solutions that works for standard kendo ui js but none of them works for angular.js.

Exmaple
http://dojo.telerik.com/EKeme

How to make it work ?
asd
Top achievements
Rank 1
 answered on 05 Nov 2014
1 answer
185 views
I am using kendo UI with AngularJS, and have ran into this issue in Firefox.

Version Information
===============
Kendo UI Version : v2014.2.1008

Issue reproducible ONLY in Firefox (v33.0.2), works fine in Chrome.

Exception stack trace :
=======================
createWidget@http://localhost/Scripts/lib/kendo.all.js:83279:13\n\n
createIt@http://localhost/Scripts/lib/kendo.all.js:83407:38\n\n
timeout/timeoutId<@http://localhost/Scripts/lib/angular/angular.js:14304:28\n\n
completeOutstandingRequest@http://localhost/Scripts/lib/angular/angular.js:4397:7\n\n
Browser/self.defer/timeoutId<@http://localhost/Scripts/lib/angular/angular.js:4705:7"

On debugging further, I figured that the issue is with 'element' argument passed to link function of 'directiveFactory' angular directive. 

module.factory('directiveFactory', ['$timeout', '$parse', '$compile', '$log', function(timeout, parse, compile, log) {
...
...
...
link: function(scope, element, attrs, controllers) {

While 'element' is interpreted as a jQuery wrapped obj in Chrome, it's just an Object inside Firefox. Hence, inside createWidget(), the following check fails inside Firefox :

            if (element.is("select")) {

As an immediate fix, I have modified createWidget() call inside createIt() 
from
           var widget = createWidget(scope, element, attrs, role, origAttr);
to
           var widget = createWidget(scope, ((element instanceof jQuery) ? element : $(element)), attrs, role, origAttr);

This resolves the issue.

Question
=========

Can you investigate this issue and suggest a permanent fix / workaround for this issue ?

Dimo
Telerik team
 answered on 05 Nov 2014
1 answer
210 views
Hi All,

I have created a page using PivotGrid and now I want to export it to an excel file.
 Anyone know how to do this?

Regards,

Rinaldi
Georgi Krustev
Telerik team
 answered on 05 Nov 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?