This topic is locked

How to control Inline Add/Edit functionality from script

11/11/2010 5:44:28 PM
PHPRunner General questions
gps088 author

Table name is "catalog_mov" and I tried the following code placed in the List, View, Add, Edit:Javascript on Load event in several parts individually :
var dTableName = 'catalogmov';
$("a[@id^=ieditlink"+pageid+"
]").each( function()
{
$(this).click();
});
Unfortunately it does not open the inline edit for the items.
Could somebody has another code to use it, please.
Thank you

J
Jane 11/12/2010

Hi,
here is code for PHPRunner 5.3:

// define detal table name:

var dTableName = 'TableName1';

// please note you need to replace all "bad characters with _ (underscore) in the table name
// define table name of current list page:

var tableName = 'TableName2';
// define object of current page list

var pageObj = Runner.pages.PageManager.getAt(tableName, pageid);
//1. Simulate "inline add" click:

pageObj.inlineAdd.inlineAdd();
//2. Edit all records:

pageObj.inlineEdit.editAllRecs();
//get number of records on the page

var recsId = pageObj.inlineEdit.getRecsId();
3. Edit record number X, where X ranges from 1 to number of records on the page:

pageObj.inlineEdit.editRecByInd(recsId[X]);
4. Open detail inline preview:
// short table name

var sTableName = Runner.pages.PageSettings.getShortTName(dTableName);
$("#"+sTableName+"_preview"+recsId[X]).click();
5. //open X edit page in popup

$("#editlink"+recsId[X]).click();



Please note all these functions will work in new build only. This build will be available in a day or two.