+ Start a Discussion

how can we save data through YUI data Table to salesforce objects


I have a VF page:-- 



<apex:page controller="testdatatable" >
<!-- Combo-handled YUI JS files: -->
<title> Yui Data Table with Visual Force Page </title>
<div id="basic"></div> 
function Init()
return true;
<script >
function addTable()
var sectionsArr= new Array();
    <apex:repeat value="{!acc}" var="a">
     var sections=new Array();
          var myColumnDefs = [          {key:"id", sortable:true, resizeable:true},      {key:"Name", sortable:true, resizeable:true}
                                        {key:"Website", sortable:true, resizeable:true}
         var sectionsArr= new Array();
        var myDataSource= new YAHOO.util.DataSource(sectionsArr);
        myDataSource.responseSchema={fields:["id","name", "website"]};
        var myDataTable= new Yahoo.widget.DataTable("basic", myColumnDefs, myDataSource, {caption:"My Salesforce Data"});




in order to save data shown on a page you need to use apex:inputfield tags inside apex:form tags and use the save action of a commandbutton.

Alternatively, for YUI or any other javascript frameworks, you will need to marshal the data from the javascript layer to the apex layer.

This is not trivial. To see an example of this you can review this article: http://wiki.developerforce.com/index.php/Visualforce_blog which uses YUI and visualforce.