Comments (5)
I think for the first problem I can do
Box - group title
row - member_1
row - member_2
[hidden div placeholder]
row - [input -> AJAX]
row - potential-member_1 [add button]
row - potential-member_2 [add button]
and replace
[hidden div placeholder]
with
row - new member
[hidden div placeholder]
from intercooler-js.
Hi There,
I can think of a few approaches:
- Group the top stuff
Box - group title
row - member_1
row - member_2
into a div and then use an ic-append targeting that div, and then something like ic-action and ic-action-target to remove the row that is clicked on:
http://intercoolerjs.org/attributes/ic-action.html
A less complicated set up would be to target the entire bit of HTML, but preserve the input value when you render it. The input would lose focus but they user has already clicked out of it to select a contact, so that shouldn't be too bad.
from intercooler-js.
Yes I agree that there are several solutions. I thought of your idea but in my case the members are row
s that are immediate children of Box
, having Box -> Div -> Row
will mess up some of the css
so I choose to have a placeholder and replace it with a Row + placeholder
. However, even without an intermediate div
, your solution would work if I move the input
element out of Box
because it does not belong there anyway.
That said, I cannot see why ic-swap-style is limited to
The value of the attribute should be one of 'replace', 'append', 'prepend'
I mean, instead of having
ic-target + ic-swap-stype (three ways to change content of `ic-target`)
ic-target + ic-replace-target (one way of replacing `ic-target`)
I think it is natural to allow ic-swap-style
to have
'replace-target', 'append-target', 'prepend-target'
in addition to
'replace', 'append', 'prepend'
with the -target
version being replacing the target entirely, appending new html after target, prepending new html before target. I believe that append-target
and prepend-target
are useful for applications such as adding new element as sibling of the current element.
For the second question i did not know that ic-action
could be specified with ic-post-to
because I had the feeling that only one "action: could be specified at a time.
from intercooler-js.
Hello,
Update on this issue: I have begun working on intercooler 2.0, renamed kutty
And it specifically supports different swap types as you have outlined. I hope to release a 0.0.1 this friday.
from intercooler-js.
Great. Congratulations on the new version/project and I look forward to using it. I think the biggest missing piece for intercooler.js is multi-element (maybe 2 is enough) actions such as "switch a tab and activate ...", "remove a row and enable".... although I do not know if and how kutty can enable these.
from intercooler-js.
Related Issues (20)
- simple Django - Intercooler.js example on how to pass a django variable to a view HOT 2
- It appears the google group is gone HOT 4
- Default values not displayed on refresh HOT 5
- IC potential clash with jquery ? HOT 2
- Set history and new URL after ic-get-from? HOT 3
- Suggest clarification on `ic-target` HOT 1
- How get and populate different targets with a single POST request HOT 3
- Can ic-get-from include value of triggered input? HOT 2
- Query string keeps getting bigger ic-get-from / ic-current-url HOT 1
- Preventing default for a button inside a form HOT 4
- ic-push-params: multiple GET parameters with same name cannot be pushed to URL HOT 1
- Intercooler.ready is executed on document.ready HOT 9
- Elements with SSE trigger do not get cleaned up when swapped out of the DOM HOT 6
- ic-action does not support chained derefences HOT 5
- New add-object form includes a dependent select HOT 2
- document bootstrap version on example(s)
- intercooler-1.1.1.min.js offline HOT 3
- ic-trigger-from not working on form with ic-post-to HOT 1
- Extending the functionality of Intercooler to other controls
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intercooler-js.