Telerik Forums
Kendo UI for jQuery Forum
2 answers
210 views

I have a TreeView implementation that often contains hierarchies that have large numbers of nodes in very flat structures.  While I have drag and drop working, the usability just isn't very good.  So, I'm implementing a cut/paste mechanism where the cut simply remembers the unique id of the source node and on paste of the target node, I get the source node using its id and attempt to .append(sourceNode, targetNode).

However, this doesn't seem to work.

Is this the best way to approach this or is there a different way I should approach this?

 

  $("#mnuHierarchyRightClick").kendoContextMenu({
            target: "#tvHierarchy",
            filter: ".k-in",
            select: function (e) 
            { 
                switch (e.item.id) 
                {
                    case "mnuHierarchyRightClickCut":

                         var tv = $("#tvHierarchy").data("kendoTreeView");
                         var dataItem =  tv.dataItem(e.target);
                    
                        self.setClipBoard(dataItem.ID,'Clipboard: ' + dataItem.Text);

                        break;

                    case "mnuHierarchyRightClickPaste":

                         
                        self.paste(e.target);

                        break;
                    default:
                        break;
                };
            }
        });

// called from click on context menu of the TreeView

MyController.prototype.paste = function (targetNode)
{
    var self = this;

    try
    {
       
        var tv = $("#tvHierarchy").data("kendoTreeView");

        if (targetNode == null) { return false; }

        var targetDataItem = tv.dataItem(targetNode);
        var pastedDataItem = tv.dataSource.get(self.ClipBoardPrimaryKeyID);

        self.setClipBoard(0,'');

        var pastedNode = tv.findByUid(pastedDataItem.uid);

        pastedDataItem.set('parentID', targetDataItem.id);
 
        tv.append(pastedNode,targetNode);

 
    }
    catch(e)
    {
        alert(e);
    }
 
}

Petar
Telerik team
 answered on 17 Jun 2020
4 answers
339 views

We just upgraded from Kendo 2016.2 to 2017.2.621 and it's seems like we can't use the setStatusClass from the drag event anymore.  The documentation says that the naming convention has changed starting with version 2016.3.914 but I've tried every pattern possible involving the k and the i without success.  None of the provided value used enabled the k-denied icon.  Also, calling setStatusClass with k-denied use todo the same job as calling a e.setValid(false); on the drop event... this ain't working anymore.

Here's a snippet that reproduce the problem.

Ivan Danchev
Telerik team
 answered on 17 Jun 2020
2 answers
164 views

Hi. I need your help about formatting my KendoUI chart.I use KendoUI chart with my Delphi + Unigui code

My doubts are in  the figure attached. The main doubt is how to format the horizontal axis to show the desired number of decimals. I want to change from one decimal ( one number after the comma like   2200,0  ) to two decimals   (like 2200,00 ). This line of code did not work TNumericField(FieldByName('distM')).DisplayFormat :=  '#,0.00';
Code to try to fix the decimals
ChartSeries.Values['Fmod'] := 'serFmod';
ChartProperties.Values['valueAxis'] := '{labels: {format: "#,0.0"}}';             // vertical  axis  one decimal
ChartProperties.Values['tooltip'] := '{visible: true, format: "#,0.000"}';          // points   3 decimals
ChartSeriesDefaults := 'labels: {visible: true, position: "insideEnd", format: "#,0.00"}';

If needed I can send a test case using Delphi + Unigui.

Sergio
Top achievements
Rank 1
 answered on 16 Jun 2020
1 answer
204 views

 

Hello,

 

I am using this code to filter a Date Column in Kendo Ui Grid

field: 'myDatetimeColumn', title: 'Date', width: "12%"
                        , filterable: {
                            ui: function (element) {
                                element.kendoDateTimePicker({
                                    format: "dd-MMM-yyyy HH:mm",
                                    timeFormat: "HH:mm"
                                });
                            }
                        }

 

But it is not filtering correctly .

Please find attached screen shots for more information.

 

Also https://dojo.telerik.com/eWAKAmoW/2  you can reproduce the issue there.

 

Regards,

Amr Saafan

https://www.nilebits.com/

Plamen Mitrev
Telerik team
 answered on 16 Jun 2020
2 answers
4.5K+ views

I understand dataSource.view() returns only data from the current page and dataSource.data() is supposed to return everything. In our case, it does not for some reason.

Here's the DataSource setup from the server

.DataSource(dataSource => dataSource
    .Ajax()
    .Read(read => read.Action("GetRevenueData", "RevenueBudgetTool").Data("GetRevenueDataParams"))
    .Model(mod => mod.Id(m => m.ClientId))
    .PageSize(12)
)

 

And here's how we tried to get all the data in Javascript

$("#RevenueBudgetToolGrid").data("kendoGrid").dataSource.data();

 

The above line returns only 12 rows of data instead of 21 (total)

Georgi
Telerik team
 answered on 16 Jun 2020
5 answers
400 views

Hello there,

i attached Photos so that you can see my problem ..

First i had the selection tag attached to my scheduler ..

So i had to click on the day and then click on the (...) Button to navigate to the correct day ..

if i click on a day and then click the (...) Button from another day .. it will navigate to the day i clicked on before clicking on the (...) Button ..

So i removed the selction tag (for now) ..

now i can't select .. so i go directly and click on the Button .. and as you can see on the Pics .. it's not going the right direction !!

 

PS : IT'S NAVIGATING TO THE ANOTHER DAY AT THE SAME MONTH !!!!!!

Ivan Danchev
Telerik team
 answered on 15 Jun 2020
3 answers
1.5K+ views

Hi, 

As an expansion on my title, Im exporting a grid with some grouping to PDF, and the results make up 2 pages, but they are both being printed on the same page, please see the attachment so I dont sound crazy.

Here follows my template, pdf config and css styling:

<script id="template-pdf-export" type="text/x-kendo-template">
  <div class="pdf-export">
    <div class="header">
      <div style="float: right">Page #: pageNum # of #: totalPages #</div>
      Version Number x.y.z
    </div>
    <div class="footer">
      Page #: pageNum # of #: totalPages #
    </div>
  </div>
</script>

 

pdf: {
  fileName: "BFO-Export.pdf",
  landscape: true,
  margin: { top: "2cm", right: "1cm", bottom: "1cm", left: "1cm" },
  paperSize: "A4",    // Required so that template and scale are used
  scale: 0.8,  // Scale down the text size when printing to PDF
  template: $("#template-pdf-export").html()
}
 
/* Basic styling for a PDF export template */
.pdf-export {
    font-family: "DejaVu Sans", "Arial", sans-serif;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}
.pdf-export .header {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    border-bottom: 1px solid #888;
    color: #888;
}
.pdf-export .footer {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    border-top: 1px solid #888;
    text-align: center;
    color: #888;
}

 

Please Advise.

Thanks,
Grant

Anton Mironov
Telerik team
 answered on 15 Jun 2020
1 answer
633 views

Hello,

I'm trying to send selected values (from grid) but the creation is coming from the scheduler ..

I saved the values in a global variable and i tried to this ..

 

THIS is the ActionMethod in the Controller :

public ActionResult Cal_Create ([DataSourceRequest]DataSourceRequest request, KommunikationViewModel kommunikation,string[] SIDMITARBEITER, string[] SIDPERSONEN, List<UserViewModel> MITARBEITER_OBJ)
        {}

 

 

Create() method from my scheduler :

.Create(create => create.Action("Cal_Create""Home").Data("pass_Einladung_Miatarbeiter_Personen"))

 

PS : i copy pasted only the create() so that i don't need to copy my whole scheduler !

 

 

This is the additional function that attached to the create() function :

 function pass_Einladung_Miatarbeiter_Personen() {
                console.log("passing the array");
                console.log(Global_Array_Grid_mitarbeiter_Selected);
                var Mitarbeiter_Grids_IDs = new Array();
                var Personen_Grids_IDs = new Array();
 
                Global_Array_Grid_mitarbeiter_Selected.forEach(function (item, index) {
                    var SID_MITARBEITER_AUS_GLOBAL = item.Sid_mitarbeiter;
                    Mitarbeiter_Grids_IDs.push(SID_MITARBEITER_AUS_GLOBAL);
                });
 
                Global_Array_Grid_person_Selected.forEach(function (item, index) {
                    var SID_Personen_AUS_GLOBAL = item.Sid_personen;
                    Personen_Grids_IDs.push(SID_Personen_AUS_GLOBAL);
                });
                var xxoop = JSON.stringify(Global_Array_Grid_mitarbeiter_Selected);
                return {
                    SIDMITARBEITER: Mitarbeiter_Grids_IDs,
                    SIDPERSONEN: Personen_Grids_IDs,
                    MITARBEITER_OBJ: xxoop}
            }

 

// so i took one value from the object and put it into an array .. and that worked like a charm .. so defining a string[] as a parameter in the create ActionMethod .. did not make any problem .. but defining a List of object (like the code snippet) or a list of Objects .. is giving always NULL ! and it's not NULL because I'm console logging this variable in almost every step .. to follow if kendo delete the values after some action .. but no .. it's there .. but not getting sent to the ActionMethod ..

Thanks in Advance ..

Aleksandar
Telerik team
 answered on 12 Jun 2020
3 answers
188 views

Here is my data source:

 

var gridDataSource = new kendo.data.DataSource({
        data: orderData,
        schema: {
            model: {
                fields: {
                    Blank: { type: "string" },
                    ERevisionsUpdated: { type: "string" },
                    TIMOrderNumber: { type: "number" },
                    TBContractNumber: { type: "string" },
                    NccOrderNumber: { type: "string" },
                    AEName: { type: "string", },
                    OrderOriginalGross: { type: "number" },
                    ClientName: { type: "string" },
                    AgencyId: { type: "string" },
                    AgencyName: { type: "string" },
                    OrigMonthlyGross: { type: "number" },
                    TIMGross: { type: "number" },
                    TIMVariance: { type: "number" },
                    TIMWhole: { type: "string" },
                    TnBGross: { type: "number" },
                    TnBVariance: { type: "number" },
                    TnBWholePercent: { type: "number" },
                    Clearance: { type: "string" },
                    StartDate: { type: "date" },
                    EndDate: { type: "date" },
                    Market: { type: "string" },
                    LatestTimNote: { type: "string" },
                    TrafficSystemId: { type: "number" }
                }
            }
        },
        aggregate: [
            { field: "TnBGross", aggregate: "average" }
        ],
        pageSize: 10,
        sort: {
            field: "TIMOrderNumber",
            dir: "asc"
        }
    });

 

Here is the grid:

 

$("#ordersGrid").kendoGrid({
        selectable: true,
        allowCopy: true,
        toolbar: ["excel", "pdf", "search"],
        pdf: {
            allPages: true
        },
        resizable: true,
        //noRecords: {
        //    template: "No Records Found! Click search to query for records."
        //},
        excel: {
            allPages: true
        },
        columnMenu: false,
        columns: [
            { command: { text: "Dropped Spots", click: showDetails }, title: " ", width: "125px" },
            { command: { text: "SET", click: showDetails }, title: " ", width: "85px" },
            { field: "ERevisionsUpdated", title: "eRevision Status", width: "135px" },
            { field: "TIMOrderNumber", title: "TIM Order #", width: "114px", minResizableWidth: 100 },
            { field: "TrafficSystemId", title: "Traffic Id #", width: "100px", minResizableWidth: 80 },
            { field: "Revision", title: "Revision Info", width: "114px", minResizableWidth: 80 },
            { field: "TBContractNumber", title: "TB Contract #", width: "121px" },
            { field: "NccOrderNumber", title: "NCC Order #", width: "114px" },
            { field: "AEName", title: "AE Name", width: "150px" },
            { field: "ClientName", title: "Client Name", width: "275px", minResizableWidth: 150 },
            { field: "AgencyId", title: "Agency Id", width: "275px", minResizableWidth: 150 },
            { field: "AgencyName", title: "Agency Name", width: "275px", minResizableWidth: 150 },
            { field: "OrderOriginalGross", title: "Order Original Gross", format: "{0:c}", width: "154px" },
            { field: "OrigMonthlyGross", title: "Orig. Monthly Gross", format: "{0:c}", width: "150px" },
            { field: "TIMGross", title: "TIM Gross", format: "{0:c}", width: "120px" },
            { field: "TIMVariance", title: "TIM Variance", format: "{0:c}", width: "121px" },
            { field: "TIMWhole", title: "TIM Whole %", template: TIMWholeFunction, width: "115px" },
            { field: "TnBGross", title: "T&B Gross", format: "{0:c}", width: "100px", footerTemplate: "" },
            { field: "TnBVariance", title: "T&B Variance", format: "{0:c}", width: "115px" },//, aggregates: ["average"], footerTemplate: "Average: #=average#"},
            { field: "TnBWholePercent", title: "T&B Whole %", template: '#=kendo.format("{0:p}", TnBWholePercent / 100)#', width: "121px" },
            { field: "Clearance", title: "Clearance Rate %", width: "147px" }, //template: '#=kendo.format("{0:p}", Clearance / 100)#',
            { field: "StartDate", title: "Start", template: startDateFunction, width: "90px" },
            { field: "EndDate", title: "End", template: endDateFunction, width: "90px" },
            { field: "Market", title: "Market", width: "175px" },
            { field: "LatestTimNote", title: "Latest TIM Note", width: "800px" }
            //{ field: "TrafficSystemId", hidden: true }
        ],
        filterable: {
            extra: false
        },
        sortable: true,
        groupable: false,
        pageable: {
            pageSize: 10,
            alwaysVisible: true,
            buttonCount: 5,
            refresh: false,
            pageSizes: true
        },
        change: onGridChange,
        dataSource: gridDataSource,
        rowTemplate: '<tr class=\"#=GetRowColorValue(StartDate, EndDate)#\" data-uid="#= uid #"><td role="gridcell"> <a class="k-button" href=\"#=GetDroppedSpotsLink(TIMOrderNumber, TrafficSystemId)#\" target="_blank">Dropped Spots</a> </td><td role="gridcell"> <a class="k-button" href=\"#=GetSetLink(TBContractNumber, AreaId)#\" target="_blank">SET</a> </td><td role="gridcell" class=\"\"><img src=\"#:GetERevImage(ERevisionsUpdated)#" height=20 width=20></td><td role="gridcell"> <a href=\"#=GetTimOrderLink(TIMOrderNumber)#\"  target="_blank">#:TIMOrderNumber#</a> </td><td role="gridcell"><a class="k-button" onclick="GetTrafficSystem(#=TrafficSystemId#)" target="_blank">#: TrafficSystemId #</a> </td><td role="gridcell" ><span class="\" onclick="GetRevisionInfo(#=TIMOrderNumber#)" target="_blank"><img src=\/Content\/images\/Exclamation.svg.png height=20 width=20></span></td><td role="gridcell">#: TBContractNumber #</td><td role="gridcell">#:NccOrderNumber#</td><td role="gridcell">#: AEName #</td><td role="gridcell">#: ClientName #</td><td role="gridcell">#: GetAgencyId(AgencyId) #</td><td role="gridcell">#: AgencyName #</td><td role="gridcell">#= GetOrderOriginalGross(OrderOriginalGross) #</td><td role="gridcell">#: GetOriginalMonthlyGross(OrigMonthlyGross) #</td><td role="gridcell">#: GetTIMGross(TIMGross) #</td><td role="gridcell">#: GetTIMVariance(TIMVariance) #</td><td role="gridcell" class=\"#=GetTimWholeColorValue(TIMWhole)#\" >#: GetTIMWhole(TIMWhole) #</td><td role="gridcell">#: GetTnBGross(TnBGross) #</td><td role="gridcell">#: GetTnBVariance(TnBVariance) #</td><td role="gridcell" class=\"#=GetTnBWholeColorValue(TnBWholePercent)#\">#: GetTnBWholePercent(TnBWholePercent) #</td><td role="gridcell">#:GetClearanceValue(Clearance)#</td><td role="gridcell">#=startDateFunction(StartDate) #</td><td role="gridcell">#=startDateFunction(EndDate) #</td><td>#: Market #</td><td role="gridcell"><a href=\"#=GetTimNoteLink(TimSystemId, TIMOrderNumber)#\"  target="_blank">#: LatestTimNote #</a></td></tr>'
    });

 

 

The field TnBGross has footerTemplate value = "". i.e. empty string. This works fine. However if you insert anything, even a space like " ", then grid breaks. What could be going wrong here?

 

Thank You!

 

Please help me to find what is wrong in here...

Petar
Telerik team
 answered on 12 Jun 2020
2 answers
114 views

Hi,

I'm wondering if anyone could point me in the direction of an example to be able to select multiple scheduler events programatically if I have the data-uid for each event to be selected. 

Also I am looking to be able to de-select a single event programatically when multiple are selected. 

Thanks,

Francis

Aleksandar
Telerik team
 answered on 12 Jun 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?