custom function for datatable?

View: New views
2 Messages — Rating Filter:   Alert me  

custom function for datatable?

by bahalul kabir :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi satyam or anyone plz,
This is default function for each row in dataTable-
support_dataTable.subscribe("cellClickEvent",function(oArgs) {

 
I need to make custom functin. Is that correct way to write :
// start custom function
var onBtnSearch = function(oArgs) {
            var searchText = YAHOO.util.Dom.get("searchText").value;
            var searchCriteria = YAHOO.util.Dom.get("searchCriteria").value;
           
            //alert(searchText + " - " + searchCriteria);
            YAHOO.util.Connect.asyncRequest("GET","index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&searchText=" + searchText +                                 "&searchCriteria="+ searchCriteria,
                {
                    success: function (o) {
                        if (o.responseText) {                          
                           //alert(o.responseText);
                                //How can update data table??
                           } else {
                            alert(o.responseText);
                        }
                    },
                    failure: function (o) {
                        alert(o.statusText);
                    },
                    scope:this
                }
            );
        }
 var btnSearch = new YAHOO.widget.Button("search");
  btnSearch.on("click", onBtnSearch);
 
// finish custom function
 
 
 
 
support_dataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload)
    {
        oPayload.totalRecords = oResponse.meta.totalRecords;
        return oPayload;
    }
    return {
        ds: support_datasourse,
        dt: support_dataTable
    };
 
Kabir


     

Re: custom function for datatable?

by juliebonniedaisy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Read these 2 excellent articles:

http://yuiblog.com/blog/2008/10/15/datatable-260-part-one/

http://yuiblog.com/blog/2008/10/27/datatable-260-part-two/
search in this 2nd one for the string "update the Recordset"

--- In ydn-javascript@..., bahalul kabir <bahar_aub@...> wrote:

>
> Hi satyam or anyone plz,
> This is default function for each row in dataTable-
> support_dataTable.subscribe("cellClickEvent",function(oArgs) {
> } 
>  
> I need to make custom functin. Is that correct way to write :
> // start custom function
> var onBtnSearch = function(oArgs) {
>             var searchText = YAHOO.util.Dom.get("searchText").value;
>             var searchCriteria = YAHOO.util.Dom.get("searchCriteria").value;
>            
>             //alert(searchText + " - " + searchCriteria);
>             YAHOO.util.Connect.asyncRequest("GET","index.php?show=ajax&module=support&startIndex=0&results='.$numResults.'&searchText=" + searchText +                                 "&searchCriteria="+ searchCriteria,
>                 {
>                     success: function (o) {
>                         if (o.responseText) {                          
>                            //alert(o.responseText);
>                                 //How can update data table??
>                            } else {
>                             alert(o.responseText);
>                         }
>                     },
>                     failure: function (o) {
>                         alert(o.statusText);
>                     },
>                     scope:this
>                 }
>             );
>         }
>  var btnSearch = new YAHOO.widget.Button("search");
>   btnSearch.on("click", onBtnSearch);
>  
> // finish custom function
>  
>  
>  
>  
> support_dataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload)
>     {
>         oPayload.totalRecords = oResponse.meta.totalRecords;
>         return oPayload;
>     }
>     return {
>         ds: support_datasourse,
>         dt: support_dataTable
>     };
>  
> Kabir
>