You need to sign in to do that
Don't have an account?
Aman
how can we save data through YUI data Table to salesforce objects
I have a VF page:--
<apex:page controller="testdatatable" >
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.2r1/build/datatable/assets/skins/sam/datatable.css"/>
<!-- Combo-handled YUI JS files: -->
<script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js&2.8.2r1/build/dragdrop/dragdrop-min.js&2.8.2r1/build/element/element-min.js&2.8.2r1/build/datasource/datasource-min.js&2.8.2r1/build/datatable/datatable-min.js"></script>
<html>
<head>
<title> Yui Data Table with Visual Force Page </title>
</head>
<body>
<div id="basic"></div>
</body>
<script>
function Init()
{
addTable();
return true;
}
YAHOO.util.Event.onDOMReady(Init);
</script>
<script >
function addTable()
{
var sectionsArr= new Array();
<apex:repeat value="{!acc}" var="a">
var sections=new Array();
sections.push('{!a.id}');
sections.push('{!a.name}');
sections.push('{!a.website}');
sectionsArr.push(sections);
</apex:repeat>
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.responseType=YAHOO.util.DataSource.TYPE_JSARRAY;
myDataSource.responseSchema={fields:["id","name", "website"]};
var myDataTable= new Yahoo.widget.DataTable("basic", myColumnDefs, myDataSource, {caption:"My Salesforce Data"});
}
</script>
</html>
</apex:page>
Hi,
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.