Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netteForms.js: support for toggling by css class, not only id #210

Merged
merged 1 commit into from Feb 11, 2019

Conversation

Ciki
Copy link
Contributor

@Ciki Ciki commented Feb 11, 2019

  • new feature
  • BC break? no

this is useful eg. for controls manually rendered as table cells <td> which have only <tr> valid parent .. if there are multiple cells within table row toggling via id is not feasible (it would toggle all the cells in that row).

Example

$form->addCheckbox('send', 'Ship to address')
	->addCondition($form::FILLED)
		->toggle('body .sendBox');

this is useful eg. for controls manually rendered as table cells `<td>` which have only `<tr>` valid parent .. if there are multiple cells within table row toggling via `id` is not feasible (it would toggle all the cells in that row).
@Ciki Ciki changed the title js: support for toggling by css class, not only id netteForms.js: support for toggling by css class, not only id Feb 11, 2019
@dg
Copy link
Member

@dg dg commented Feb 11, 2019

Thanks

@dg dg merged commit 8e01765 into nette:master Feb 11, 2019
2 checks passed
dg pushed a commit that referenced this issue Feb 11, 2019
this is useful eg. for controls manually rendered as table cells `<td>` which have only `<tr>` valid parent .. if there are multiple cells within table row toggling via `id` is not feasible (it would toggle all the cells in that row).
@dg
Copy link
Member

@dg dg commented Feb 11, 2019

I changed it to full CSS selector.

dg pushed a commit that referenced this issue Feb 11, 2019
this is useful eg. for controls manually rendered as table cells `<td>` which have only `<tr>` valid parent .. if there are multiple cells within table row toggling via `id` is not feasible (it would toggle all the cells in that row).
dg pushed a commit that referenced this issue Feb 11, 2019
this is useful eg. for controls manually rendered as table cells `<td>` which have only `<tr>` valid parent .. if there are multiple cells within table row toggling via `id` is not feasible (it would toggle all the cells in that row).
dg pushed a commit that referenced this issue Feb 19, 2019
this is useful eg. for controls manually rendered as table cells `<td>` which have only `<tr>` valid parent .. if there are multiple cells within table row toggling via `id` is not feasible (it would toggle all the cells in that row).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants