This topic is locked

How to control inline edit/add functions programmatically

8/23/2007 7:37:45 PM
PHPRunner Tips and Tricks
Sergey Kornilov admin

The best place to insert the following code snippets is at the very end of the list page.

Open List page in Visual Editor, find the closing </BODY> tag and insert code snippet right before it.

Wrap this code in &lt;script> ... </script> tags.

...

&lt;script>inlineAdd(newrecord_id++); </script>

</body></html>


1.Simulate "inline add" click:
inlineAdd(newrecord_id++);
2. Edit all records
setTimeout('$("a[@id^=ieditlink]").each( function() { if(this.id!="ieditlink_add") $(this).click(); });',1000);
3. Edit record number X
$("a#ieditlinkX").click();
where X ranges from 1 to number of records on the page.
You can combine more than one action:
&lt;script>

inlineAdd(newrecord_id++);

$("a#ieditlink3").click();

</script>
This will display inline add form and will make record number 3 editable.

S
seldon 10/23/2007

I've tried to insert on my project this:
<script>setTimeout('$("a[@id^=ieditlink]").each( function() { if(this.id!="ieditlink_add") $(this).click(); });',1000);
</script>
but don't work for me it say :
Smarty error: [in Approvazione_ferie_list.htm line 209]: syntax error: unrecognized tag: if(this.id!="ieditlink_add") $(this).click(); (Smarty_Compiler.class5.php, line 436)
please help me <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=22497&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />

J
Jean 10/26/2008

You have to replace { by the term {ldelim} and } by {rdelim}

I've tried to insert on my project this:

<script>setTimeout('$("a[@id^=ieditlink]").each( function() { if(this.id!="ieditlink_add") $(this).click(); });',1000);
</script>
but don't work for me it say :
Smarty error: [in Approvazione_ferie_list.htm line 209]: syntax error: unrecognized tag: if(this.id!="ieditlink_add") $(this).click(); (Smarty_Compiler.class5.php, line 436)
please help me <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=34402&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />

R
RedDaisy 8/17/2009

I tried it but it doesn't work...
...

&lt;script>inlineAdd(newrecord_id++); </script>

</body></html>