Giter VIP home page Giter VIP logo

Comments (6)

bmichotte avatar bmichotte commented on May 26, 2024

Could you please show the code of your cell ?

from promotion-xlform.

grimmwerks avatar grimmwerks commented on May 26, 2024

Sure - I tried a couple of ways - first as your docs showed, then trying to get the redraw via the value, seeing if applying style would fix it:

https://gist.github.com/grimmwerks/3a7348784c36d49aa9229aee497b1be6

https://gist.github.com/grimmwerks/8ec8ec0f7adc5efb582983ab7da87ac5

a video showing the issue: https://www.dropbox.com/s/e1ty94asqr8caye/straps_redraw.mp4?dl=0

REALLY appreciate the assist; if it's something really stupid I'm doing.

from promotion-xlform.

grimmwerks avatar grimmwerks commented on May 26, 2024

...also very curious if you can create your own class for a section, or at least add buttons in a footer of a section. I'm sure at worst I could just use a cell for one item to add buttons to manipulate other areas but still curious.

from promotion-xlform.

grimmwerks avatar grimmwerks commented on May 26, 2024

Thanks for jumping in on slack; Mark's example was fantastic; just for others I'm pasting in what seems to work for me (which is exactly what you have in the docs; I'm unsure why it was a problem for me to begin with):

class StrapCell < PM::XLFormCell
  attr_accessor :position, :tension, :name
  attr_accessor :strap_name, :strap_position, :strap_tension

  include StrapCellStylesheet



  def initWithStyle(style, reuseIdentifier: reuse_identifier)
    super.tap do
      create_cell_items
    end
  end



  def create_cell_items
    @strap_image ||= append!(UIImageView, :strap_image)
    @strap_name ||= append!(UILabel, :strap_name)
    @strap_position ||= append!(UILabel, :strap_position)
    @strap_tension ||= append!(UILabel, :strap_tension)

    apply_style :strap_cell


  end

  def update
    super
    self.data_cell ||={}

    # create_cell_items

    @strap_name.text = value[:strap]
    @strap_position.text = "Position: #{value[:position]}"
    @strap_tension.text = "Tension: #{value[:tension]}"

  end

end

from promotion-xlform.

bmichotte avatar bmichotte commented on May 26, 2024

@grimmwerks Glad to hear that.

Could I ask you to PR a section on the doc for cells when using RedPotion ?

from promotion-xlform.

grimmwerks avatar grimmwerks commented on May 26, 2024

Sure thing; I'm going to be doing a number of different custom cells / styling sections, so once I figure out a few things I definitely will!

from promotion-xlform.

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.