Telerik Forums
Kendo UI for jQuery Forum
3 answers
467 views

Hi Team,

We are facing issue with exported PDF.

We are not able to get print out from the exported PDF file.

When we try to get print out then only small portion from the pdf is printed on single page.

Please help us how we can take print out from exported PDF.

Thanks!

Aleksandar
Telerik team
 answered on 19 Aug 2020
1 answer
175 views

I'm using the cellClose event to update cell values, it works within the values in the selected row. I have a last row called Total which is the sum of the Values of the Column D
----------Column_A Column_B Column_C Column_D
----------Product1---ValueB1---ValueC1-------ValueD1
----------Product2---ValueB2---ValueC2-------ValueD2
----------Total------------------------------------------ValueT
Column D= Column_C * Column_B and ValueT = ValueD1 + ValueD2
When i update ValueC1 or ValueB1 , ValueD1 gets updated and re-rendered with the new value . The problem is that the ValueT gets udpated but it doesnt re-render .
The code i have is this one :

cellClose:function(e){<br>    var dataItem=e.sender.dataItem($(e.container).parent())// getting the current edited row<br>    var aux= e.sender.dataSource.data(); //getting all rows<br>    var dataTotal= aux[aux.length-1]; //geting total row<br>    <br>    valueB=dataItem["Column_B"];<br>    valueC=dataItem["Column_C"];<br>    dataItem.set("Column_D",valueB*ValueC);<br>    <br>      var sum=0;<br>       for (let i=0;i<aux.length-1;i++)//getting sum of values of Column_D<br>       {<br>               sum=sum+aux[i].Column_D;<br>       } <br>      dataTotal.set("Column_D",sum) // setting sum<br>    <br>    <br>    } <br>

 

Petar
Telerik team
 answered on 19 Aug 2020
1 answer
84 views

I'm using the cellClose event to update cell values, it works within the values in the selected row. I have a last row called Total which is the sum of the Values of the Column D
----------Column_A Column_B Column_C Column_D
----------Product1---ValueB1---ValueC1-------ValueD1
----------Product2---ValueB2---ValueC2-------ValueD2
----------Total------------------------------------------ValueT
Column D= Column_C * Column_B and ValueT = ValueD1 + ValueD2
When i update ValueC1 or ValueB1 , ValueD1 gets updated and re-rendered with the new value . The problem is that the ValueT gets udpated but it doesnt re-render .
The code i have is this one :

 

cellClose:function(e){
var dataItem=e.sender.dataItem($(e.container).parent())// getting the current edited row
var aux= e.sender.dataSource.data(); //getting all rows
var dataTotal= aux[aux.length-1]; //geting total row
 
valueB=dataItem["Column_B"];
valueC=dataItem["Column_C"];
dataItem.set("Column_D",valueB*ValueC);
 
  var sum=0;
   for (let i=0;i<aux.length-1;i++)//getting sum of values of Column_D
   {
           sum=sum+aux[i].Column_D;
   }
  dataTotal.set("Column_D",sum) // setting sum
 
 
}
Petar
Telerik team
 answered on 19 Aug 2020
1 answer
3.9K+ views
I'm grouping the grid through the datasource and I want to hide the left-most column, the one I so poorly highlight in my screenshot.  That's just a test grid, but it represents the column I want removed.   Removing  .k-group-cell will remove it but that messes up the colspan of the row.  Even decreasing the width will suffice but that attribute doesn't seem to take affect.

Dimo
Telerik team
 answered on 19 Aug 2020
1 answer
105 views

In the following example I want to show the Id of the category when the corresponding "columns.values" is not found. Is there a way to do it easily?

in the "burger" line it is blank, and I want that in that case at least its category is displayed

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
  columns: [
    { field: "productName" },
    { field: "category", values: [
      { text: "Beverages", value: 1 },
      { text: "Food", value: 2 }
    ] }
  ],
  dataSource: [
    { productName: "Tea", category: 1 },
    { productName: "Ham", category: 2 },
    { productName: "Burger", category: 3 },
    
  ],editable: true,
});
</script>

Petar
Telerik team
 answered on 19 Aug 2020
4 answers
128 views

Hi, 

As my title says, when I clear selected values in the input, additional values selected.

See Dojo: https://dojo.telerik.com/UgOVISOL

Duplicate:
1) Open the widget and select an element under the Customer Location group
2) Close the widget
3) Click the X button on the tag to remove the selected Customer Location.

See how it adds an additional value to the selected list. This is somehow linked to the filtering in the change callback because when I remove the change callback, it works fine. N.B. this only happens when clearing the value using the X, if the value is deselected, all is fine

The desired behaviour is that when a customer location is selected, the customer accounts in the datasource are filtered by the selected customer location. This part is working though.

Thanks, 
Grant

Martin
Telerik team
 answered on 18 Aug 2020
3 answers
278 views

Hi all.

In this example: https://demos.telerik.com/kendo-ui/grid/multicolumnheaders.
How can I lock / unlock columns from the column menu?

 

Thank you in advande.
Regards,
Carlos Conde

Petar
Telerik team
 answered on 18 Aug 2020
1 answer
312 views

I have the the following code:

module App.UI {
    export class News extends App.UI.UIComponent {
        constructor(selector: JQuery | string) {
            super(selector);
        }

        protected init() {
            var dataSource = new kendo.data.DataSource({
                transport: {
                    read: () => {
                        App.WCF.GET('/umbraco/aawNewsSurfaceController/NewsSurface/GetNewsItems?lang=de&id=1396').then((response) => {
                            console.log(response, "response");
                        })
                    }
                },
                pageSize: 21
            });

            console.log(dataSource);

            $("#pager").kendoPager({
                dataSource: dataSource
            });

            $(".news-list-view").kendoListView({
                dataSource: dataSource,
                template: kendo.template($("#ListViewTemplate").html())
            });
        }
    }
}

The Response from my Service is the following JSON String:

[ { "Headline": "Lorem Ipsum", "Content": "<p>Lorem ipsum ...</p>", "PublishDate": "2020-08-07T00:00:00", "Image": { "Description": "", "Photographer": [], "UmbracoFile": { "src": "/media/bedfs1h5/bild02.jpg", "focalPoint": { "left": 0.5, "top": 0.5 }, "crops": [ { "alias": "Reference Slider", "width": 800, "height": 545, "coordinates": null }, { "alias": "Slider", "width": 1070, "height": 600, "coordinates": null }] }, "Key": "fcdafa9b-3dff-407d-88b2-a4b85a9b2ac5", "Id": 1330, "Name": "Porsche Schwarz", "UrlSegment": null, "Level": 4, "Path": "-1,1111,1062,1146,1330", "Cultures": { "": { "Culture": "", "Date": "2020-07-13T15:47:22.943Z" } } } }, { "Headline": "Test 2", "Content": "<p>Test</p>", "PublishDate": "2020-08-15T00:00:00", "Image": { "Description": "", "Photographer": [ "Karl Kani" ], "UmbracoFile": { "src": "/media/pmpbnlqi/porsche.jpg", "focalPoint": { "left": 0.71333333333333337, "top": 0.34261241970021411 }, "crops": [ { "alias": "Reference Slider", "width": 800, "height": 545, "coordinates": { "x1": 0.0, "y1": 0.032119914346895075, "x2": 0.0, "y2": 0.092612419700214138 } }, { "alias": "Slider", "width": 1070, "height": 600, "coordinates": null } ] }, "Key": "3e95e2e9-c808-48d2-a71e-efca00d8ba55", "Id": 1147, "Name": "Porsche-Zentrum, Stuttgart-Zuffenhausen", "UrlSegment": null, "Level": 4, "Path": "-1,1111,1062,1146,1147", "Cultures": { "": { "Culture": "", "Date": "2020-03-04T09:28:31.753Z" } } } } ]

 

The JSON String can be parsed into a valid JSON Object so it should be fine right? So whats the Problem here? I also tried using the following schema:

 var dataSource = new kendo.data.DataSource({
                transport: {
                    read: () => {
                        App.WCF.GET('/umbraco/aawNewsSurfaceController/NewsSurface/GetNewsItems?lang=de&id=1396').then((response) => {
                            console.log(response, "response");
                        })
                    }
                },
                schema: {
                    type: "json",
                    model: {
                        fields: {
                            Headline: { field: "Headline", type: "string" },
                            Content: { field: "Content", type: "string" },
                            PublishDate: { field: "PublishDate", type: "DateTime" },
                            Image: { field: "Image", type: "Object" }
                        }
                    }
                },
                pageSize: 21
            });

And still my ListView Datasource wont get populated.

Any Help would be appreciated.

Thank you.

 

Petar
Telerik team
 answered on 18 Aug 2020
1 answer
167 views

Hi,

 

I have the export to excel button on my grid. I want all the cells to be expanded so that i can see the entire content of each cell in excel.

 

I have attached screenshots below for the same.

 

Here is the link to the demo:-

https://dojo.telerik.com/OMetasiq

 

Ivan Danchev
Telerik team
 answered on 17 Aug 2020
9 answers
528 views

Hi all
I am trying to format the date data to this format: "yyyy-MM-dd HH: mm: ss".
The function I am using is:

excelExport: function(e) {
    var sheet = e.workbook.sheets[0];
    var grid = e.sender;
    var fields = grid.dataSource.options.fields;
    var fieldsModels = grid.dataSource.options.schema.model.fields;
    var columns = grid.columns;
    var dateCells = [];
    
    var len = fields.length - 1; //subtract one because a column is added with a command button
    for (var i = 0; i < len; i++) {
        var currentField = fields[i].field;
        var currentModel = fieldsModels[currentField];
        
        if (currentModel.type === "date") 
            for (var j = 0; j < columns.length; j++) {
                if (currentField === columns[j].field) {
                    dateCells.push(j);
                    break;
                };
            };
        };
    };
    for (var rowIndex = 1; rowIndex < sheet.rows.length; rowIndex++) {
        var row = sheet.rows[rowIndex];
        for (var q = 0; q < dateCells.length; q++) {
            var cellIndex = dateCells[q];
            if(row.cells[cellIndex]){
                row.cells[cellIndex].format = "yyyy-MM-dd HH:mm:ss";}
        };
    };
}

When I export without grouping, the date field in the excell has the expected format, but when I export grouped by another string type field the date field shows a format "yyyy-MM-dd".
How could I solve this?

Anton Mironov
Telerik team
 answered on 17 Aug 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?