formBuilder
formBuilder copied to clipboard
Unable to save data of rendered form- Rating control plugin
Description:
Thanks Kevin, for creating this wonderful tool.
I am using the the rating plugin with typeUserAttrs (custom attribute) "ratingData".
typeUserAttrs: { starRating: { ratingData: { label: 'Rating', value: '5' } } }
However, once i render the form > fill in the form (change the rating). And then save the userData using:
$('#' + SurveyPages[currentPageIndex].PageId).formRender('userData');
The above return the data perfectly, but the value of typeUserAttrs (custom attribute) "ratingData" remains the same i.e. 5. Below is the onRender method for rating plugin.
onRender() {
var el = this;
$('#' + el.config.name).rateYo({
onSet: function (rating, rateYoInstance) {
$(rateYoInstance).next().val(rating);
// tried setting the config
el.config.ratingData = rating;
// tried setting the raw config
el.rawConfig.ratingData = rating;
// tried setting the value as well
el.config.value = rating;
},
rating: el.config.ratingData || 3,
numStars: el.config.noStars || 5,
fullStar: true,
});
}
Please advise how to get the updating value. Any help would be really appreciated.
I searched google and checked all the issues as well, but couldn't find a fix for it that is why i am reporting here.
Environment Details:
- formBuilder Version:
- Browser:
- OS:
Expected Behavior
$('#' + SurveyPages[currentPageIndex].PageId).formRender('userData');
Actual Behavior
Return the default value
Steps to Reproduce
Screenshot - (optional)
we're on the same page, please update if you found any solution. Thanks
we're on the same page, please update if you found any solution. Thanks
any solution for this @iftkharhussain ?
:tada: This issue has been resolved in version 3.14.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket: