This is a migrated thread and some comments may be shown as answers.

Spreadsheet validation problem

6 Answers 245 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 25 Mar 2016, 05:32 PM

I try to add Data Validation to a range with List as validation type.

- first row is disabled to show column titles

- my validation range is B2:B50

Data validation for the first cell (B2) is working, but oher cells in B column does not work.

Can you help me ?

The code:

<div id="spreadsheet" style="width: 100%;"></div>

$(function () {
    var spreadsheet = $("#spreadsheet").kendoSpreadsheet({
        toolbar: false,
        //sheetsbar: false,
        sheets: [
            {
                rows: [
                    {
                        cells: [
                            { value: "Fonds" },
                            { value: "Sens" },
                            { value: "Code" },
                            { value: "Quantité" },
                            { value: "Cours" }
                        ]
                    }
                ]
            },
            {
                name: "ListAchatVente",
                rows: [
                    {
                        cells: [
                            {
                                value: "A"
                            },
                            {
                                value: "V"
                            }
                        ]
                    }
                ]
            }
        ]
    }).data("kendoSpreadsheet");
 
    var range = spreadsheet.activeSheet().range("1:1");
    range.enable(false);
 
    var columnSens = spreadsheet.activeSheet().range("B2:B30");
    columnSens.validation({
        dataType: "list",
        from: "ListAchatVente!A1:B1",
        allowNulls: true,
        type: "reject",
        titleTemplate: "Valeur invalide",
        messageTemplate: "Valeur autorisée: 'A' ou 'V'."
    });
});

 

6 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 30 Mar 2016, 07:51 AM
Hi,

Please accept my apologies for the delayed response.

The validation seems to be working in my tests. Can you please check if you're using the latest version?

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
David
Top achievements
Rank 1
answered on 30 Mar 2016, 08:40 AM
hi,

I must not understand the validation system, because when I add a V in B2, it works, but if I add a V in B3, validation displays the incorrect validation message.

Screenshot attached

 

0
David
Top achievements
Rank 1
answered on 30 Mar 2016, 08:43 AM

hi,
I must not understand the validation system, because when I add a V in B2, it works, but if I add a V in B3, validation displays the incorrect validation message.
Screenshot attached

regards,

David

0
Accepted
T. Tsonev
Telerik team
answered on 01 Apr 2016, 11:12 AM
Hi,

My mistake here. I'm not sure how I tested this exactly the last time around, but it's definitely not working as expected.

That said, we found the issue. The from range is not locked to the row and expands with the validated range. Fixing it is simple:
    from: "ListAchatVente!$A$1:$B$1"

I'll check if we can enhance the docs to make this clear.
Apologies for the caused inconvenience.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
David M
Top achievements
Rank 1
answered on 21 Apr 2016, 05:08 PM

Thanks for posting this question, I was wondering the same thing yesterday and got my code working.

 

 Although I'm having another issue.  After I apply the "list" validation on a range of cells the flags appear properly at first.  Once I click anywhere on the page, flags appear improperly on ALL of my cells. Once I make a change anywhere on the spreadsheet the flags appear properly again.  

Did either of you see this issue?

0
T. Tsonev
Telerik team
answered on 26 Apr 2016, 05:57 AM
Hello David,

I tried reproducing this issue, but without success.
Can you take my sample and update it to illustrate the problem? Thanks!

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Spreadsheet
Asked by
David
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
David
Top achievements
Rank 1
David M
Top achievements
Rank 1
Share this question
or