How to shift Create, Cancel links column in ADD mode

Talk about implementing of customized templates

Moderators: ne_moj, zewa

rssridhar17
Junior
Junior
Posts: 21
Joined: Dec 8th, '11, 05:01

How to shift Create, Cancel links column in ADD mode

Postby rssridhar17 » Jan 19th, '12, 11:45

Hi Admin,

I am using this example: code_2_2_example.php - for inline add/edit/del

Currently in ADD mode, when we click "+Add New"
We get "Create, Cancel" links at the beginning of the datagrid and then the fields to enter, at the end, that is last column "Delete"
Pl let me know how to shift the first column links "Create, Cancel", just before "Delete" column.

This is intended for a quick data entry, where we donot use mouse operation, we use only tab key.

administrator
Site Admin
Site Admin
Posts: 5938
Joined: Jan 7th, '09, 23:18
Contact:

Re: How to shift Create, Cancel links column in ADD mode

Postby administrator » Jan 19th, '12, 15:08

You have to customize datagrid.class, currently such feature doesn't exists.

rssridhar17
Junior
Junior
Posts: 21
Joined: Dec 8th, '11, 05:01

Re: How to shift Create, Cancel links column in ADD mode

Postby rssridhar17 » Jan 20th, '12, 05:34

Hi Admin,

Is there way to add customised buttons through which we can shift.

Is it too complicated to do this at datagrid.class

administrator
Site Admin
Site Admin
Posts: 5938
Joined: Jan 7th, '09, 23:18
Contact:

Re: How to shift Create, Cancel links column in ADD mode

Postby administrator » Jan 22nd, '12, 11:06

What do you mean "customized" buttons? Images? CSS?

rssridhar17
Junior
Junior
Posts: 21
Joined: Dec 8th, '11, 05:01

Re: How to shift Create, Cancel links column in ADD mode

Postby rssridhar17 » Jan 23rd, '12, 05:23

Adding custom buttons means, adding a new column and buttons(images) for Create / Cancel.
Switching off the 1st column which comes default.

I am asking these questions only to increase the speed of a data entry, where it is tedious to each time use mouse to click on "create" in ADD mode.

I found another solution to this but not sure how and where to add these in the datagrid.class.php, probably this is easier to implement.

adding accesskey to links where in the user need not use mouse for clicking, he can use shortcut keys like ALT+C

Example:
<a href="index3.htm" accesskey="c">Home</a>

administrator
Site Admin
Site Admin
Posts: 5938
Joined: Jan 7th, '09, 23:18
Contact:

Re: How to shift Create, Cancel links column in ADD mode

Postby administrator » Jan 23rd, '12, 10:09

Ok, so you may add this in DrawModeButton() method, that draws mode buttons.

rssridhar17
Junior
Junior
Posts: 21
Joined: Dec 8th, '11, 05:01

Re: How to shift Create, Cancel links column in ADD mode

Postby rssridhar17 » Jan 23rd, '12, 12:31

Hi Admin,

It is difficult to understand datagrid.class.php, need your help as to where I need to add code for:
accesskey="a" for Create link and accesskey="q" for Cancel.
and accesskey="z" for +Add New link in ADD Mode of inline addition

please insert accesskey="a" for Create in the below lines of DrawModeButton:

@line 3259
if(isset($this->templates[$this->layoutType]['header'])){
// Add button
$mode_button = $this->DrawModeButton("add", "javascript:".$this->uniquePrefix."_doPostBack(\"add\",\"".Helper::EncodeParameter('-1', $this->safeMode)."\", \"".$this->urlString."\");", $this->lang['add_new'], $this->lang['add_new_record'], "add.gif", "''", false, "", "", true);
$template_header = str_replace("[ADD]", $mode_button, $this->templates[$this->layoutType]['header']);


@line 3317
// Add button
$mode_button = $this->DrawModeButton("edit", "javascript:".$this->uniquePrefix."sendEditFields();", $this->lang['create'], $this->lang['create_new_record'], "update.gif", "''", false, $this->nbsp, "", true);
$template = str_replace("[CREATE]", $mode_button, $template);

$param = $this->amp.$this->uniquePrefix."new=1";
$mode_button = $this->DrawModeButton("cancel", "javascript:".$this->uniquePrefix."verifyCancel(\"-1\", \"".$param."\")", "".$this->lang['cancel'], $this->lang['cancel'], "cancel.gif", "''", false, $this->nbsp, "", true);
$template = str_replace("[CANCEL]", $mode_button, $template);
$template = str_replace("[UPDATE]", "", $template);


Return to “Add/Edit/View Mode Templates Implementing”