Giter Site home page Giter Site logo

Comments (5)

BoPeng avatar BoPeng commented on August 29, 2024

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.

1cg avatar 1cg commented on August 29, 2024

Hi There,

I can think of a few approaches:

  1. 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.

BoPeng avatar BoPeng commented on August 29, 2024

Yes I agree that there are several solutions. I thought of your idea but in my case the members are rows 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.

1cg avatar 1cg commented on August 29, 2024

Hello,

Update on this issue: I have begun working on intercooler 2.0, renamed kutty

https://kutty.org

And it specifically supports different swap types as you have outlined. I hope to release a 0.0.1 this friday.

from intercooler-js.

BoPeng avatar BoPeng commented on August 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.