Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Validation not working for multiple columns #94

Closed
chrishakai opened this issue Aug 17, 2016 · 6 comments
Closed

Validation not working for multiple columns #94

chrishakai opened this issue Aug 17, 2016 · 6 comments

Comments

@chrishakai
Copy link

When I do validation for multiple columns the first one works but the second one does not.

Looking at the excel xml, the validations seem to be nested when I would expect them to be separate...

<dataValidations count="2">
    <dataValidation type="list" allowBlank="1" showErrorMessage="1" errorTitle="Validation Error" error="Permitted options: &#xA; A,B" sqref="A1:A5">
        <formula1>"A,B"</formula1>
        <dataValidation type="list" allowBlank="1" showErrorMessage="1" errorTitle="Validation Error" error="Permitted options: &#xA; C,D" sqref="B1:B5">
            <formula1>"C,D"</formula1>
        </dataValidation>
        <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>
    </dataValidation>
</dataValidations>

See https://gist.github.com/chrishakai/b42e366c048c427ef25e21a849732f29

@amekkawi amekkawi added the bug label Sep 14, 2016
@amekkawi
Copy link
Collaborator

Thanks for the gist. I'll also look into why the pageMargins element is in there as well

@chrishakai
Copy link
Author

Hi there, I am wondering if there any updates to this? I would really like to get validations added to our spreadsheets. Thanks again for an awesome tool!

@gnatowski
Copy link

gnatowski commented Dec 13, 2016

You have in dataValidation.js:

  function  addToXMLele(ele) {
        let valsEle = ele.ele('dataValidations').att('count', this.length);
        this.items.forEach((val) => {
            val.addToXMLele(valsEle);
        });
        valsEle.up();
    }

It must be:

    function addToXMLele(ele) {
            var valsEle = ele.ele('dataValidations').att('count', this.length);
            this.items.forEach(function (val) {
                val.addToXMLele(valsEle);
                valsEle.up();
            });
        }

chrishakai added a commit to HakaiInstitute/excel4node that referenced this issue Jan 25, 2017
@chill-patel
Copy link

chill-patel commented Nov 8, 2017

Why this code is not present in current master branch.

@natergj
Copy link
Owner

natergj commented Nov 8, 2017

@sunilpatel2, sorry for the delays on handling PRs and issues. I had written this module while working at a previous employer while leading software development for a project that required the functionality. Once I left that employer in July 2016, my hopes were that my old employer would be able to continue maintenance of the module. Sadly, that did not happen. I asked for the repo to be transferred back to me and that happened this week. I am slowly going through the backlog of PRs and issues, but since I will essentially be doing this in my spare time, it is not going to be an immediate process. This weekend is a long weekend in the USA where I live and I am hoping to get through a lot of this backlog and release a new version of the module to the npm repository by the end of the weekend.

@natergj
Copy link
Owner

natergj commented Nov 12, 2017

validation issues have been fixed in commit ff629a225335dc784933c06aabd20ddca5fcdbef

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants