Telerik Forums
Kendo UI for jQuery Forum
2 answers
210 views

Dear admins,

I'm debugging with kendo UI Web and I face an issue, could you please help me answer the reasons.

LanguageespaƱol

Case 1: kendo.toString(1.1, "N1"); --> Result: 1.1

Case 2: kendo.toString(12.12, "N2"); --> Result: 12.12

Case 3: kendo.toString(123.123, "N3"); --> Result:  ,123.123     --> I don't know why the result is ",123.123".

Case 4: kendo.toString(1234.1234, "N4"); --> Result: 1234.1234

 

Thanks.

Viktor Tachev
Telerik team
 answered on 09 Jul 2018
1 answer
415 views

i am getting data from a web API call which will be used to populate a chart and 2 grids. is it possible to parallel load all 3 controls , so that user need not to wait till all controls gets loaded one by one and page has something to display?

 

Thanks

Konstantin Dikov
Telerik team
 answered on 09 Jul 2018
3 answers
381 views

I am using a diagram for a very specific purpose and have disabled most of the editing. I only want my customers to be able to drag and drop the objects.  No resizing, rotating, adjusting connections..etc. 

I have successfully completed all of that but there is a workaround for the user if they click and do not drag a shape, when they release the mouse button a  popup appears with some controls.   

How do i disable this popup or what object event is causing it to come up so i can override it?

thank you!

Alex Hajigeorgieva
Telerik team
 answered on 06 Jul 2018
7 answers
2.9K+ views
I'm having a problem after server side validation fails and the model is returned to the editor.

Here is the code for the model field that needs to be edited using the kendo editor:
[Required]
[MaxLength(120, ErrorMessage = "You must enter less than 120 characters.")]
public string HelpContent { get; set; }
At the moment the HelpText filed has the following data in the database:
<p>Bacon ipsum dolor sit amet shoulder tenderloin corned beef, hamburger chicken ham hock strip steak.</p>
When the page is initially displayed the text above is rendered in the kendo editor as expected (with styles instead of html tags - see goodeditor image). Inspecting Model.HelpContent within the razor code shows that the field contains the above code.

When the form is submitted with the above content, the content is encoded so that it looks like:

&lt;p&gt;Bacon ipsum dolor sit amet shoulder tenderloin corned beef, hamburger chicken ham hock strip steak.&lt;/p&gt;

The ActionResult that is handling the post:
public ActionResult EditRepositoryHelp(RepositoryHelpEditModel repositoryHelpEditModel)
{
    if (ModelState.IsValid)
    {
        repositoryHelpEditModel.HelpContent = HttpUtility.HtmlDecode(repositoryHelpEditModel.HelpContent);
        Repository.UpdateRepositoryHelpText(repositoryHelpEditModel);
        return RedirectToAction("Index", "Admin");
    }
 
    repositoryHelpEditModel.HelpContent = HttpUtility.HtmlDecode(repositoryHelpEditModel.HelpContent);
    return View(repositoryHelpEditModel);
}
Inspecting the repositoryHelpEditModel.HelpContent field shows the encoded content, which is under 120 characters so it is decoded and saved to the database.

However, when the text is updated so that there are more than 120 characters and then the form submitted,  the validation fails (since the length of repositoryHelpEditModel.HelpContent is > 120). For example if I add the text "More text." to the editor and submit then the value of repositoryHelpEditModel.HelpContent will be:

&lt;p&gt;Bacon ipsum dolor sit amet shoulder tenderloin corned beef, hamburger chicken ham hock strip steak. More text.&lt;br /&gt;&lt;/p&gt;

Since the validation fails, HelpContent is decoded again and the model is returned to the view to be displayed in the editor.

This time the text is rendered with html tags (see badeditor image) instead of showing marked up content.

Here is the code for the editor:
@( Html.Kendo().EditorFor(model => model.HelpContent)
                .Encode(true)
                .HtmlAttributes(new { style = "width:100%;height:440px" })
                .Tools(tools => tools.Clear()
                    .Bold().Italic().Underline().FontSize().FontColor().JustifyLeft()
                    .JustifyCenter().JustifyRight().JustifyFull().InsertUnorderedList()
                    .InsertOrderedList().Indent().CreateLink().ViewHtml()))

Is this a bug with the editor or am I doing something wrong here?

Dimitar
Telerik team
 answered on 06 Jul 2018
3 answers
251 views

Hello.

 

I didn't find a way to export Grid to pdf. Nor I found .excel export. Could you let me know when are you going to release these features?

Svet
Telerik team
 answered on 06 Jul 2018
3 answers
299 views

Hello

In PUT and POST operation all number properties of my entity are sent in string format. In my GET operation, I receive my entity with correct value, but when I send my entity, my datasource convert number properties in string.

My datasource definition :

var _FrmTest_dtTtOrigineGeographique = new kendo.data.DataSource({
            type: "odata-v4",
            content: "json",
            transport: {
                read: {
                    url: "https://localhost:9443/odata/EntiteTtOrigineGeographiques",
                },
                update: {                     
                    url: function (data) { return "https://localhost:9443/odata/EntiteTtOrigineGeographiques(" + data.IdTtOrigineGeographique + ")" },
                }
                 
            },
            schema: {
                model: {
                    id: "IdTtOrigineGeographique",
                    fields: {
                        IdTtOrigineGeographique: {
                            type: "number",
                            editable: false,
                        },
                        StrLibelle: {
                            type: "string"
                        },

                        Pourcentage: {

                             type: "number"

                        }

                    }
                }
            },
            error: function (e) {
                console.log(e.xhr);
            },
            filter: {
                logic: "and",
                filters: [
                    { field: "IdTtOrigineGeographique", operator: "eq", value: _idTtOrigineGeographiqueSelect }]
            },
            serverFiltering: true,
            serverSorting: true
        });

With GET operation, I receive my entity like this

{"@odata.context":"https://localhost:9443/odata/$metadata#EntiteTtOrigineGeographiques","@odata.count":1,"value":[{"IdTtOrigineGeographique":5,"StrLibelle":"Autres dƩpartements", "Pourcentage": 4.55}]}

But when I update my entity and I call sync method, my datasource send my entity like this :

{"IdTtOrigineGeographique":"5","StrLibelle":"Autres dƩpartement","Pourcentage":"4.55"}

I verify JSON.stringify() and kendo.stringify() functions and my entity is correctly serialize

For integer property it's not blocking because my webservice convert automatically string to integer. But with float (ex : 4.55), I have a exception and my entity it's not deserialize.

Can you help me ? Thanks in advance

Arnaud

Veselin Tsvetanov
Telerik team
 answered on 05 Jul 2018
3 answers
158 views

Hi

Is there a way I can control the transition style of a view? I would like to let some views slide in from top, bottom, left or right. Is that somehow possible?  I am already doing this but not with views, just DIVs and an own slide function. I would like to do that with views so I don't have to care about rotation things, etc. 

Regards

Misho
Telerik team
 answered on 05 Jul 2018
2 answers
75 views

I have a local data source which is a JS array. I setup transport methods to read/write the data. When the data is modified by Kendo widget like grid it works fine.

If I modify the array directly outside a widget in JS, how can I tell Kendo that the data source changed?

 

Thanks!

Brett
Top achievements
Rank 1
 answered on 05 Jul 2018
1 answer
950 views

I am new to Kendo, I have a dropdownList and on Change I would like to set all of the rows in the dropDownList to "Sold" . Right now I do have the change portion of the DropDownList working but can not seem to change the value of any rows . This is my code and I am trying to follow this  example here anyways this is my code below . I have about 12 rows and my field name is Names . I am also getting an error when I try to complete that below and it says Uncaught TypeError: Cannot read property 'set' of undefined . Any suggestions on getting this resolved would be great . Again all I am trying to do is set all the rows below dropdownList with the field Names to John when someone changes value in the dropdown .

 

 <div id="MyGrid" style="text-align: center;"> </div>
function statusUpdate(element)
 {    
element.element.kendoDropDownList({       
 optionLabel: "-Select-",  dataTextField: "text",  dataValueField: "value",       
 dataSource: [{ text: "Scott", value: "Scott" },{ text: "Sam", value: "Sam" }],        
change: function (e) { 
     
    var grid = $("#MyGrid").data("kendoGrid");
        var dataItem = grid.dataSource.get(2);
        dataItem.set("Names", "John");
 
    }
   })
}
Dimitar
Telerik team
 answered on 05 Jul 2018
3 answers
405 views

I have a grid, which uses detailInit, inside the detail row I have a grid with a toolbar template with an Add and Delete button. When I click the Add button to add a new row to the grid, the new row gets added but the detail row collapses.

How can stop that from happening?

John
Top achievements
Rank 1
 answered on 04 Jul 2018
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?