function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Chayan AroraChayan Arora 

how to display list in apex:page using knockoutjs component

Hi All,
My first concern is: I want to display list in vf page using knockjs component and 
My second concern is: when we edit/update/delete any record then vf page show changes in list which I have done in salesforce without reloading page.
Chayan AroraChayan Arora
This is my code to display list in vf page using knockout js.
<apex:page controller="ListView">
<script src="//cdnjs.cloudflare.com/ajax/libs/knockout/3.1.0/knockout-min.js"></script>
<table>
	<thead>
		<tr>
			<th>Name</th>
			<th>Email</th>
			<th>Designation</th>
			<th>Salary</th>
		</tr>
	</thead>
	<tbody data-bind="foreach: emplist">
		<tr>
			<td data-bind="text: Name"></td>
			<td data-bind="text: Email__c"></td>
			<td data-bind="text: Designation__c"></td>
			<td data-bind="text: Salary__c"></td>
		</tr>
	</tbody>
</table>
 
<script type="text/javascript">


	function MyViewModel() {

		var self = this;
		
		self.emplist = ko.observableArray();
		
		ListView.ListViewMethod(function(result){
                    self.emplist(result);
        	test();
        });
         
    };

      	var test = function()
      	{
      		self.emplist.push({Name: 'a', Email__c:'a@gmail.com', Designation__c: 'Developer', Salary__c:'25000'});
      	}

    ko.applyBindings(new MyViewModel());
</script>
</apex:page>
now anyone know about my second concern please reslove it asap.