Survey-library: Deeper Dynamic Question CSS Button Controls

Created on 20 Sep 2017  路  4Comments  路  Source: surveyjs/survey-library

Are you requesting a feature, reporting a bug or ask a question?

feature

What is the current behavior?

Buttons have CSS classes applied for dynamic questions with the same styling: https://github.com/surveyjs/surveyjs/blob/4eab3d1f45709990ba1fb279de5eb808a19b4fe0/src/defaultCss/cssbootstrap.ts#L23

What is the expected behavior?

Is it possible to separate button CSS by their functionality? This would allow customization of the matrixdynamic and paneldynamics in the same way that panelAddText and panelRemoveText allow for the button text to change.

E.g.:
matrixdynamic: { root: "table", buttonAdd: "button", buttonRemove: "button" },

Implemented enhancement

Most helpful comment

All 4 comments

This is also required for "proper" bootstrap integration. Remove buttons tend to get some class like btn-danger while add buttons have something like btn-success or btn-primary. Currently this is not possible.

I've added this customizations.
This is the code sample for survey-knockout:

  var myCss = {
    matrixdynamic: {
      buttonAdd: "btn-success",
      buttonRemove: "btn-danger"
    }
  };
  Survey.Survey.cssType = "bootstrap";
  var model = new Survey.Model(json);
  model.css = myCss;

  model.render("surveyElement");

Thanks! What about doing the same for panel dynamic?

Was this page helpful?
0 / 5 - 0 ratings