godwin Pinto7224819
Posts: 0
Joined: Fri Nov 14, 2014 3:02 pm

How do I add HTML text to database

Hi,

I am creating a receipe database and the column of Ingredients and Method will have a lot of text. I need those text to be formatted. Is there a way I can add HTML formatted Text to the column?

Image

What is the best way to deal with this?

Thanks in advance for your help

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How do I add HTML text to database

Hi godwin,

You can paste in your string type column needed HTML.

Then you can use following code to paste this code in component as HTML:

pre

//Here you should use value from DB.
var value = "111";

//Where "labelName" is your label name.
Apperyio("labelName").html(value);

/pre

Regards

godwin Pinto7224819
Posts: 0
Joined: Fri Nov 14, 2014 3:02 pm

How do I add HTML text to database

Thanks Yurii for your reply.

Honestly, I am not very clear on where I should paste the code? Could you clarify.

I pasted the following code in the row of the column

var value ='Ingredients for Chicken Tikka:
2 tablespoon ginger & garlic paste
1 teaspoons ground turmeric
1 teaspoon ground coriander
1 teaspoon ground cumin
1 teaspoon kashmiri red chilli powder
1/2 cup yoghurt
few drops red food colour (optional)
salt to taste
1 pound(approx 450 gms) skinless, boneless chicken breasts, halved lengthwise
Long shaslik/bamboo skewer
Ingredients for Chicken Tikka Masala Curry:
2 teaspoon garam masala
1/2 teaspoon turmeric
1 tablespoon ghee/vegetable oil
1 cup onion paste
1 cup tomato paste
8-10 cashews ground to smooth paste (Please note: people with nut allergy please avoid the cashew paste)
3 cardamom pods, crushed
1 tablespoon kashmiri red chilli powder
1 tablespoon kasoori methi( dried fenugreek leaves)
1/2 cup cream
For garnishing:
1/2 cup chopped fresh coriander for garnish';
//I put the value I need in the database

Apperyio("Ingredients").html(value)

Image

Am I doing it right?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How do I add HTML text to database

Hi Godwin,

Unfortunatly it's not clear about what you want implement.

Please show us your app mockups or screen shots from app and describe in details how do you want to populate components.

Also please clarify what service you use and does it returns correct item/items for now.

Thanks & regards.

godwin Pinto7224819
Posts: 0
Joined: Fri Nov 14, 2014 3:02 pm

How do I add HTML text to database

Hi Yurii,

Apologies for the delay, I redid everything from scratch but still haven't been successful. I have used the guidance on 'Building a Musicshop app using Model and Storage' fro the Devcentre. Below are the screenshot of the steps I followed.

  1. Created the Model
    Image

  2. Created storage
    Image

  3. Created list page
    Image

  4. Created Detailed recipe page
    Image

  5. Created Database
    Image

  6. Mapped database to detailed recipe page

    Image

    I want the html data from Ingredients and method in the HTML components that I have placed in collapsible.

    Can you tell me what am I doing wrong here?

    Appreciate your help.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How do I add HTML text to database

Hi Godwin,

Thanks for the detailed description.

You just need to link service response parmaters with HTML goal components.

  1. Delete current link to these components.
    http://prntscr.com/59its1/direct

  2. Create links:
    2.1. From Response parameter "Ingredients" to HTML component(ingredients).
    2.2. From Response parameter "Method" to HTML component(method).

    See example:
    http://prntscr.com/59iu7f/direct

    Regards.

Return to “Issues”