Meet us at Drupa 24. Dusseldorf/Germany. May. 28 - Jun 7.
Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
benadams  
#1 Posted : Wednesday, April 18, 2018 3:35:40 PM(UTC)
benadams

Rank: Advanced Member

Groups: Member
Joined: 3/20/2018(UTC)
Posts: 61

Thanks: 4 times
I'm trying to lord State id in iframe.

it's works when i put stateid directly, but don't works when put it like a variable.

there is my code

var configuration = { widgets: { FinishButton: { mode: "Disabled" } }};

var editorFrame = $("#editorFrame");

var editor = null;

function handleError(error, message) {

console.error(message, error);

return error;

};

var loadData = null;

var userId = "anonymous_1rxtizfpvjvcago0q2x5vgos";

var stateId = "5aed6517-4644-4ce1-aa2a-9b7d8a3e98e3";

//Loading a product into the editor.

//CustomersCanvas.IframeApi.loadEditor(editorFrame[0],'5aed6517-4644-4ce1-aa2a-9b7d8a3e98e3',{ userId: userId }) //works

CustomersCanvas.IframeApi.loadEditor(editorFrame[0],{ state: stateId },{ userId: userId }) // don't works

AntonIlinykh  
#2 Posted : Wednesday, April 18, 2018 9:43:01 PM(UTC)
AntonIlinykh

Rank: Newbie

Groups: Member, Moderator
Joined: 4/18/2018(UTC)
Posts: 9

Was thanked: 3 time(s) in 3 post(s)
You have to pass stateId as a string, not a key-value pair.

Please, try this:

Code:

CustomersCanvas.IframeApi.loadEditor(
  editorFrame[0],
  stateId,
  {userId: userId}
) 
thanks 1 user thanked AntonIlinykh for this useful post.
benadams on 4/19/2018(UTC)
benadams  
#3 Posted : Thursday, April 19, 2018 1:00:02 AM(UTC)
benadams

Rank: Advanced Member

Groups: Member
Joined: 3/20/2018(UTC)
Posts: 61

Thanks: 4 times
THAT's work fine thanks a lot
AntonIlinykh  
#4 Posted : Thursday, April 19, 2018 2:53:24 AM(UTC)
AntonIlinykh

Rank: Newbie

Groups: Member, Moderator
Joined: 4/18/2018(UTC)
Posts: 9

Was thanked: 3 time(s) in 3 post(s)
You are welcome!
benadams  
#5 Posted : Thursday, April 19, 2018 9:11:50 AM(UTC)
benadams

Rank: Advanced Member

Groups: Member
Joined: 3/20/2018(UTC)
Posts: 61

Thanks: 4 times
SORRY ANTONLLINYKH, i'm back again.

to load State id dynamically, i have created script able to

get a variable sent by a previous page by a php post méthod.

I wrote this line to get that variable in my actual page

<div id="stateid">

<P class="white"> <?php $text=$_POST['text'];

echo $text; ?></P>

</div>.

that's works fine

NOW

I need to affect the content of php variable to the StateId like this:

var stateId = $(" <?php echo $text;?>");

but it doesn't work. my editor don't lord

Can you help me?

AntonIlinykh  
#6 Posted : Thursday, April 19, 2018 7:56:26 PM(UTC)
AntonIlinykh

Rank: Newbie

Groups: Member, Moderator
Joined: 4/18/2018(UTC)
Posts: 9

Was thanked: 3 time(s) in 3 post(s)
What kind of error in the console do you have?

Are you sure, that $text is not empty?

And please try this:

Code:

var stateId = "<?php $text=$_POST['text']; echo $text;?>";
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.