Comments (9)
Hi,
There is no built-in functionality to do it yet.
Do you use knockout or react version?
In react version, you may override mainClassName() property of the ReactSurveyQuestionmatrix component.
Thank you,
Andrew
from survey-library.
I've tried to make a demo and does not like the result. There are a lot of code.
I will introduce the ability to change the class attribute via simple API.
I will be back soon.
Thank you,
Andrew
from survey-library.
Thanks Andrew. That will be very helpful.
from survey-library.
It is done.
Please take a look at these examples:
Knockout: http://surveyjs.org/examples/survey-customcss.html
React: http://surveyjs.org/examplesreact/survey-customcss.html
Having all css classes in one variable was a good idea.
It allows me to remove the code duplication in knockout templates and react classes. The code is better now. There is still a room for improvement of course :-)
Thank you,
Andrew
from survey-library.
Thank you. Unfortunately it is giving the below error, while trying to use the latest compiled 'survey.bootstrap.js'
survey.bootstrap.js:4213 Uncaught ReferenceError: template is not defined
from survey-library.
I have corrected the gulp.js file. It should be fine now.
PS: you could call gulp makedist the second time. It would compiled successful as well.
Thank you,
Andrew
from survey-library.
Thanks - with latest build the error is gone.
It is also working fine applying the custom css (for paged, matrix kind of questions) for the table from page2 onwards. But on the first page, it is not applying the custom style when the page loads. (If you however click on previous
and come back to first page, it then applies the style).
var survey = new Survey.Survey(pagedQuestionnaire, htmlTagId);
survey.onComplete.add(sendDataToServer);
survey.onValidateQuestion.add(ensureAnswer);
survey.css = {
matrix: { root: "table blah table-striped" },
navigationButton: "button btn-lg"
};
Also, observed that the custom 'navigation Buttonstyle is not getting applied to the
previousand
next,
complete` buttons (not even after clicking next page).
This is how it is looking on the first page (with bootstrap and table-striped custom style, which was not applied)
If you click on next
and comeback to first page, then you can see the table with custom style applied (still buttons not changed)
from survey-library.
var survey = new Survey.Survey(pagedQuestionnaire, htmlTagId);
It actually renders the survey, the first page and navigation buttons, since the element parameter is set (htmlTagId).
You may fix it by adding the css parameter:
var css = {
matrix: { root: "table blah table-striped" },
navigationButton: "button btn-lg"
};
var survey = new Survey.Survey(pagedQuestionnaire, htmlTagId, css);
or by calling the render method later:
survey = new Survey.Survey(pagedQuestionnaire);
survey.css = {
matrix: { root: "table blah table-striped" },
navigationButton: "button btn-lg"
};
survey.render(htmlTagId);
from survey-library.
Cool - worked like charm. Thanks much for your time and efforts on this.
from survey-library.
Related Issues (20)
- Ranking + Dynamic Matrix. Drag-n-Drop Issue HOT 1
- Thank You message is invisible in Contrast Dark Theme HOT 1
- Setting matrix column width in pixels doesn't work when the survey's `widthMode` is `"auto"`
- Angular crashes on first website when adding Radio Group HOT 3
- The currency masked input doesn't work when on specific min and max values HOT 1
- [Angular] Panel: A required mark is painted black instead of red
- Progress Bar: The last page is never selected regardless of answers on this page
- Scroll appearing shifts a survey. HOT 1
- Password Masking Feature - Implement an option to replace typed characters with an asterisk (*) to conceal sensitive data and prevent it from being read
- Multipletext question add mask support
- Add time support into datetime mask type
- Add text aligment property into numeric mask type
- How to customize multiple select UI when click to select field in mobile view HOT 1
- `showPreviewBeforeComplete` causes duplicate questions to appear in the preview results screen in Survey Creator HOT 5
- Matrix column settings: The `setValueExpression` property value disappears after switching between tabs
- Boolean question animation issue (safari only).
- is there any way we can get currently focused ItemValue in choices question like QuestionDropdownModel , QuestionCheckboxModel
- Dynamic Panel: Empty space appears when using `templateVisibleIf` to display panels conditionally
- Masked Input - Support an Email Input mask type
- Multi-Select Dropdown (Tag Box) displays the Select All placeholder in read-only mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from survey-library.