frappe.ui.Listing

98 views
Skip to first unread message

hamdan k abu taima

unread,
May 29, 2014, 2:02:00 AM5/29/14
to erpnext-dev...@googlegroups.com
Hello , 
what is frappe.ui.Listing is actually do ?!
ex:
var list = new frappe.ui.Listing({
hide_refresh: true,
appframe: wrapper.appframe,
method: 'erpnext.home.page.activity.activity.get_feed',
parent: $(wrapper).find(".layout-main"),
render_row: function(row, data) {
new erpnext.ActivityFeed(row, data);
}
});
list.run();

also where can I learn more about frappe in advanced , the developer guide is not helping a lot now 

can you advice !

Rushabh Mehta

unread,
May 29, 2014, 2:31:41 AM5/29/14
to erpnext-dev...@googlegroups.com
Unfortunately this code is not documented. We will get to it, but might take sometime. You can learn by seeing code samples!

frappe.ui.Listing is a generic list object that manages permissions and paging.



@rushabh_mehta

--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/d89166c6-2050-4040-aade-4a34aae8bdc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

hamdan k abu taima

unread,
May 29, 2014, 3:17:37 AM5/29/14
to erpnext-dev...@googlegroups.com
Thanks, I understand that the heavy  work to document everything,
may be you can advice in this simple task :
now I have an app , 
in js file i want to call a function in python file to retrieve data [ string ] 
js file : balance.js
py file : balance.py

how should I retrieve data from within js file , data is in python function .
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Rushabh Mehta

unread,
May 29, 2014, 3:20:17 AM5/29/14
to erpnext-dev...@googlegroups.com
1. whitelist your python function using @whitelist()
2. use $.ajax /api/method/yourmodule.balance.yourmethod




@rushabh_mehta

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/601f11de-fd35-487c-882e-f509a79668af%40googlegroups.com.

hamdan k abu taima

unread,
May 29, 2014, 3:53:05 AM5/29/14
to erpnext-dev...@googlegroups.com
Excuse me cz I am very fresh into this , 
here is my js simple ajax call

$.ajax({
type: "POST",
url: "/api/method/userbalance.balance.balance",
dataType: "json"
}).done(function( msg ) {
    alert( "Data :" + msg );
  });


here is my python 
from __future__ import unicode_literals
import frappe
from frappe.utils import cint
@frappe.whitelist()
def cdr():
"""get feed"""
return "hello"

It fails to return hello ,
Notes ( browser ):
http://0.0.0.0:8000/api/method/userbalance.balance.balance

ImportError

ImportError: No module named userbalance.balance


S userbalance is there but it cant see it ,

I wanted to be sure if its only my new module , so I tried this :

http://0.0.0.0:8000/api/method/Home.activity.get_feed

but is also failed ,note : get_feed back is adjusted to not accept parameters for testings , and hard-coded limits variables .

ImportError: No module named Home.activity





@rushabh_mehta

Rushabh Mehta

unread,
May 29, 2014, 4:38:24 AM5/29/14
to erpnext-dev...@googlegroups.com
Make sure you put the correct module path. It is

http://localhost:8000/api/method/erpnext.home.page.activity.activity.get_feed

There is an issue about showing the correct error message - fixing that.



@rushabh_mehta

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5d3436e7-aa3f-4bc4-ac2f-a7f0dc1206bc%40googlegroups.com.

hamdan k abu taima

unread,
May 29, 2014, 4:43:27 AM5/29/14
to erpnext-dev...@googlegroups.com
Solved , that was an issue of paths
Thanks
Reply all
Reply to author
Forward
0 new messages