This topic is locked

How to control inline edit/add functions programmatically

8/23/2007 7:30:47 PM
ASPRunnerPro Tips and tricks
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.

...

<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:

<script>

inlineAdd(newrecord_id++);

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

</script>


This will display inline add form and will make record number 3 editable.

B
benlikesbikes 1/29/2008

I tried doing #2 and I keep getting an ASP and/or VBScript error. There are some single quotes (') in the statement so ASP just reads that as a comment and ignores the rest. Is the syntax correct on this?
<script>

setTimeout('$("a[@id^=ieditlink]").each( function() { if(this.id!="ieditlink_add") $(this).click(); });',1000);

</script>

R
rascasse83 12/10/2008

This was really usefull thanks
it permitted us to go from a 4 click action from a user front-end point of view

to a 2 click action with the inline edit opening for all records straight away !
Brilliant <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=35851&image=1&table=forumreplies' class='bbc_emoticon' alt=':lol:' />

C
cr80rb 5/8/2009

I want to Add inline /Edit inline one field only Example Exit_Hour , what I do ??

admin 5/11/2009

cr80rb,
you can control which fields to be editable on 'Choose pages' screen in the program.

R
RASM 9/17/2009

Hi
I tried put in list.asp ......{END body}<script>inlineAdd(newrecord_id++);</script></body></html>
but generated error javascript object expected
Any solution?
thanks