Custom module: sort by custom field

Posted by Community Admin on 05-Aug-2018 18:08

Custom module: sort by custom field

All Replies

Posted by Community Admin on 29-Jan-2011 00:00

Hello,

I develop a custom module to manage a list of agents. An agent is defined by a lastname, a firstname, an address...

Here is the declaration of the "lastname" field in my model.

[CommonProperty, DataMember, Sortable, UserFriendlyDataType(UserFriendlyDataType.ShortText)]
       public string LastName
       
           get
           
               return this.lastName;
           
           set
           
               this.lastName = value;
           
       

Here is the definition of my gridview:
var contactsGridView = new MasterGridViewElement(backendContentView.ViewsConfig)
           
               ViewName = ContactsDefinitions.BackendListViewName,
               ViewType = typeof(MasterGridView),
               AllowPaging = true,
               DisplayMode = FieldDisplayMode.Read,
               ItemsPerPage = 50,
               ResourceClassId = typeof(ContactsResources).Name,
               SearchFields = "LastName, FirstName",
               SortExpression = "LastName ASC",
               Title = "ContactsViewTitle",
               WebServiceBaseUrl = "~/Sitefinity/Services/Content/Contacts.svc/"
           ;

When i go to my page to create a new contact I have a loop javascript alert with this message:
Could not deserialize service response, because it was empty or not a valid JSON.

Do you have any idea of what causes this error?

Thanks

Jocelyn

Posted by Community Admin on 01-Feb-2011 00:00

Hello jocelyn,

Please can you send a sample project with DB to check the problem locally.

Best wishes,
Teodor
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 07-Aug-2011 00:00

I'm having same exact issue. Do you have any advice please?

Posted by Community Admin on 10-Aug-2011 00:00

Hi Su,

It is clear that problem is with deserialization of web service response, but  we need more information about the data that cause this issue at custom implementation.


Can you send us your configuration and database that can give us a clue what is the problem ?

Thanks in advance!

Kind regards,

Milena
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Posted by Community Admin on 13-Aug-2011 00:00

Thank you for your reply. I managed to find the issue. I forgot to add entries to the Resources file for my new fields. After that it did work.

Thanks again.

This thread is closed