Telerik Forums
Kendo UI for jQuery Forum
1 answer
1.9K+ views

    Hi,

I am displaying a container with a bunch of info, and I am using conditionals to make some of them appear if certain bools return true. This causes an issue with my formatting though because instead of going to a new line when the text appears, it actually appears next to the text that was already there. Is there a way to add a </br> on the binding of the text?

Basically the below checks if the variable exists is true, and if so it sets the variable string to "Success </br>" so that it will add a line break after the text "Success".

var string = null;
if (exists) {
    string = "Success </br>"
}
var returnStatus = kendo.observable({
    status: success
});
kendo.bind($("#status"), returnStatus);
Steven
Top achievements
Rank 1
 answered on 19 Jul 2019
8 answers
384 views
We are thinking to use Kendo grid to allow end users creating personalized view of dashboard wherein we have 20 different columns pertaining to order e.g. OrderTitle, OrderDescription, OrderAmount, DateCreated, DateAuthorized and so on. We have created database view to feed data to KendoDatasource. 
  
WE plan to develop Admin screen that allows and saving to DB(MyViewSettings)

1. choose what columns they want to see on their report(ColumnVisibility checkbox in kendo grid)
2. specify filter criteria(FilterMenu in Kendo grid)
3. specify Group by columns(GroupByHeader in Kendo grid)

How do we save Kendo grid settings when user hits - Save View and load grid based on above settings when they view grid.

Can you provide suitable sample that demonstrates how we can achieve this?
Alex Hajigeorgieva
Telerik team
 answered on 19 Jul 2019
3 answers
1.0K+ views

I need a default value for a field that I get from a datasource, and bind to that field using an observable. (That value can then be updated if needed by the user using a treeview). I can read the initial remote datasource, build the observable and bind the value to the field. I can then pop up a dialog, show a tree and return the values. What I cant seem to do is set the value of the observable because it is based on a datasource, and therefore seems to be a much bigger and more complicated json object which I am viewing in the console. I have also had to bind differently in order to get that working as well as shown below.

Below if just a snippet, but should give an idea. The remote data source returns just: {"name":"a name string"}

<p>Your default location is currently set to: <span id="repName" data-bind="text: dataSource.data()[0].name"></span></p>

<script>
    $(document).ready(function () {

    var personSource2 = new kendo.data.DataSource({
        schema: {
                model: {
                    fields: {name: { type: "string" }}
                }
            },
        transport: {
            read: {
                url: "https://my-domain/path/paultest.reportSettings",
                dataType: "json"
            }            
        } 
    });

    personSource2.fetch(function(){
    var data = personSource2.data();
    console.log(data.length);  // displays "1"
    console.log(data[0].name); // displays "a name string"

        var personViewModel2 = kendo.observable({
        dataSource: personSource2
        });

    var json = personViewModel2.toJSON();
    console.log(JSON.stringify(json)); 

    observName1 = personViewModel2.get("dataSource.data.name");
    console.log("read observable: "+observName1);

    kendo.bind($(''#repName''), personViewModel2);

    });

 

After a lot of playing around, I managed to get the value to bind using: data-bind="text: dataSource.data()[0].name" but I can't find this documented anywhere. Where I output the observable to the console, I get a great big object, not the simple observable data structure I was expecting. I suspect I am missing something fundamental here! I am currently just trying to read the observable above, but can't get it to return the string from the json source.

Petar
Telerik team
 answered on 19 Jul 2019
1 answer
658 views
I have a custom hidden div that appears when the user selects grid content. It sums the selected cells in the amount column and then binds it to this text. The text currently appears under my grid externally. I was actually wonder if there is a way to display that in the header above the column headers kind of like how the Export to Excel button is?
Alex Hajigeorgieva
Telerik team
 answered on 18 Jul 2019
2 answers
172 views

I have a panel bar based on a remote data source which all works fine. One of the attributes in the feed combined with a form field on the screen will determine if either the user can click on a child item in the panelbar and navigate through to the url, or gets a warning dialogue and navigation fails.

I am using the following technique to capture the given json attribute in the feed and associate it with each item in the panel:

 

$("#panelbar").kendoPanelBar({

        dataSource: haRepList,
        template: "<span class=''repType'' data-url=''#= item.type #''>#= item.name #</span>",
        select: function(panel){
           var classId =  $(panel.item).find(".repType").data(''url'');
           if (classId !== ''undefined'') {
           alert(classId);
           }
        },
        dataTextField: ["name", "name"]
    });

 

So when I click on the given item, I get an alert telling me what the type attribute is (just for debugging!). I now need to tell the panel "Do not allow the click through url to work" based upon both this value, and another field on the screen.

Paul
Top achievements
Rank 1
 answered on 18 Jul 2019
2 answers
99 views

Hi!

I am using Kendo diagram on the client and we've managed to do it really easy.

But we had a request for generating the diagram image to include it in reports generated on the server.

Tried to search the API docs and forums for a solution but couldn't find any. 

The current approach we're taking is to load kendo js lib into nodejs to generate the graph and save it. Our problem with this approach is that Kendo depends on jQuery and we can't seem to load it in a way that Kendo would know how to use.

Do you have any suggestion on our approach or a different approach on which we can achieve our result?

iFACTS Admin
Top achievements
Rank 1
 answered on 18 Jul 2019
2 answers
269 views

In the following example, the collapse and expand on the gantt tree list is not working: http://dojo.telerik.com/exIWoQeY

What am I missing?

Vaishali
Top achievements
Rank 1
 answered on 17 Jul 2019
10 answers
242 views

Hi,

In TreeList i am enable Pageable and use dataBound

When fire first dataBound, data-uid is actual

then press refresh button and data-uid not updated in table

https://dojo.telerik.com/IgUwuYAn

In exemple first alert contains dataItem.LastName, then press button refresh, and dataItem not found, alert old data-uid

Angel Petrov
Telerik team
 answered on 17 Jul 2019
4 answers
266 views

Hi, 

Trying to deploy our Vue application we have noticed that our Vendor chunk is very big - and a large portion of it seems to be Kendo related. Even if we split our vendor file using the code below we create a giant progress file (3.5GB) that needs to be downloaded - and when we uncomment the console.log section - it seems that kendo-ui is the largest portion of the file - and it includes a lot of components (like spreadsheet, for example) that we do not need.

 

Do you have any suggestions how we limit the kendo components that are distributed when we do 'npm run build' - to just the ones we use? 

--

configureWebpack: config => {
config.optimization = {
splitChunks: {
chunks: 'all',
maxInitialRequests: Infinity,
minSize: 0,
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name (module) {
//get the name. E.g. node_modules/packageName/not/this/part.js
//or node_modules/packageName
let packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];

//console.log(module.context + ' >>> ' + packageName);
//npm package names are URL-safe, but some servers don't like @ symbols
return `npm.${packageName.replace('@', '')}`;
}
}
}
}
};

--

 

If we add a second line to break progress with:

 

if (packageName === '@progress') {
packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)(.*?)([\\/]|$)/)[3];
}

 

we see that kendo-ui is still gigantic (3.3GB) and contains stuff we do not use, for example spreadsheet, dataviz:

 

D:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js >>> kendo-ui
D:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js >>> kendo-ui
D:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js >>> kendo-ui
D:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js\spreadsheet >>> kendo-ui
D:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js\util >>> kendo-ui
:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js >>> kendo-ui
D:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js\dataviz\stock >>> kendo-ui
D:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js\dataviz\stock >>> kendo-ui
D:\finanda\myfinanda-web\node_modules\@progress\kendo-ui\js >>> kendo-ui

Martin
Telerik team
 answered on 17 Jul 2019
1 answer
157 views

Hello,

I use menu in toolbar as buttons with class k-icon

When i'm focus cursor on menu then icon changed to icon k-loading

Example: https://dojo.telerik.com/UXoGefaj/2

Error ocсure after update to kendo ui version 2019.2.619.

Dimitar
Telerik team
 answered on 17 Jul 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?