TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Adhikar Patil
NA
481
128.3k
How to set required attribute on checked event in jqgrid
Jan 27 2019 2:12 AM
Hello,
Here is my code How to Set Required attribute to DefectNo when IsElementDefect is checked and remove required attribute on IsElementDefect Unchecked.
colModel: [
{label: 'Is Defect', name: 'IsElementDefect', width: 130, align: 'center', edittype: "checkbox",
hidden: true, editable: true, editrules: { edithidden: true }, hidedlg: true}
editoptions: {
text: "IsElement:IsDefect", value: '1:0',
dataEvents: [
{
type: 'change', fn: function (e) {
if ($('#IsElementDefect').is(':checked')) {
$('#tr_DefectNo').show();
$('#tr_DefectNo').attr('required', 'required');
$('#tr_DefectNo').prop('required');
}
else {
$('#tr_DefectNo').hide();
$('#tr_DefectNo').removeAttr('required');
}
}
}]
}, formatter: "checkbox", formatoptions: { disabled: false }, sortable: false
},
{label: 'Element No', name: 'ElementNo', width: 130, editable: true, stype: "select", edittype: "select", editrules: { required: true }},
{label: 'Defect No', name: 'DefectNo', width: 130, editable: true, stype: "select", edittype: "select", editrules: { required: true }},
Please provide me solution as soon as possible
Reply
Answers (
1
)
How to apply css for specific column of that rows in jqgrid
how to add textbox using tag-it jquery