call ajax function with specific action ?

Hi All

i have created a controller with action subscribers

like this


class LeadsController extends SugarController
{
	public function action_subscriber()
    {	
    	$this->view = 'sub';     
    }  
}

and i have added a button callled as subscribers in my search form

now on click on that button if i want to make search happen so i am calling SUGAR.savedViews.setChooser(); SUGAR.ajaxUI.submitForm(this.form); this two function


<input tabindex='2' title='go_select' id='go_select_b' ondblclick="SUGAR.savedViews.setChooser(); SUGAR.ajaxUI.submitForm(this.form);" class='button' type='button' name='subscriber' value='Subscriber'/>

but when i click on the button its going to

module=Leads&action=index

i want to trigger a ajax or ( i want to make search with )

module=Leads&action=subscriber

so how can i change the action on click of "SUGAR.savedViews.setChooser(); SUGAR.ajaxUI.submitForm(this.form); this function

please can any one guide me on this ???/

i have also tried with this SUGAR.ajaxUI.submitForm(document.forms[‘SubView’]) ??

so how can i change the action on click of "SUGAR.savedViews.setChooser(); SUGAR.ajaxUI.submitForm(this.form); this function ???/ :unsure:

i tried some thing like this SUGAR.ajaxUI.submitForm(document.forms[‘SubView’]);

but its still not working can any one guide me on this ??

i found this here http://developer.sugarcrm.com/2011/09/30/improving-sugarcrm-client-side-performance-the-sugarcrm-ajaxui/

Hi All ,

ANy idea how to solve this SUGAR.ajaxUI.submitForm(document.forms[‘SubView’]); ??

trigger ajax for specific view instead of SUGAR.ajaxUI.submitForm(this.form); ??

.

Hi Admins & All ,

Can some one guide me on this ??

trigger ajax for specific view instead of SUGAR.ajaxUI.submitForm(this.form); in search form ??

Thanks For your time & support

Hi Admin ,

can you guide me on this ?

:ohmy:

.

Have you tried adding custom JavaScript to your view then using the id of the button to trigger an ajax call to your new action? I would simple use Jquery to do an entirely custom ajax call to your action. Very simple to do imo.

Hi andy ,

thanks for the reply !

yes i have tried with that and its working but ,

i was curious that why can’t we use sugar method to trigger a ajax on specific view action

please let me know , if there is a way to trigger an ajax using yui . i tried like this SUGAR.ajaxUI.submitForm(document.forms[‘SubView’]);

Thanks for your time