This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

couedeloalexandre12023
couedeloalexandre12023

I'm working on a membership management grid/checker

Membership Management Picture

Github repo

I'have created a partial that allow to use switch button on backendList (/widget/partial/_field_switch.htm)

when I switch, the AJAX request run membership/controllers/MembershipChecker.php catch the request

I switch the value ( $value = !post($name); ) , I update the model ( ProfileModel::where('user_id', $id)->update([$name => $value]); )

Then I switch the value in the view ( data-request-success="$('#<?= $column->getName() ?>_<?= $record->id ?>').attr('value', data['value'] );" )

Ok ! all theses steps works. But when I switch the same button again (without refresh), It doesn't works. When I debug, I see that the AJAX framework do exectly the same request without take into account the change of the value attribute. I think that the AJAX framework doen't check the value attribute each time it run.

I don't know if it is a feature of AJAX framework. How can I by pass this trouble ?

Last updated

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.