{"action":"created","issue":{"url":"https://api.github.com/repos/SAP/openui5/issues/1094","repository_url":"https://api.github.com/repos/SAP/openui5","labels_url":"https://api.github.com/repos/SAP/openui5/issues/1094/labels{/name}","comments_url":"https://api.github.com/repos/SAP/openui5/issues/1094/comments","events_url":"https://api.github.com/repos/SAP/openui5/issues/1094/events","html_url":"https://github.com/SAP/openui5/issues/1094","id":169887138,"number":1094,"title":"sap.ui.model.odata.v2 operationMode:client sort issue","user":{"login":"hschaefer123","id":2110971,"avatar_url":"https://avatars0.githubusercontent.com/u/2110971?v=4","gravatar_id":"","url":"https://api.github.com/users/hschaefer123","html_url":"https://github.com/hschaefer123","followers_url":"https://api.github.com/users/hschaefer123/followers","following_url":"https://api.github.com/users/hschaefer123/following{/other_user}","gists_url":"https://api.github.com/users/hschaefer123/gists{/gist_id}","starred_url":"https://api.github.com/users/hschaefer123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hschaefer123/subscriptions","organizations_url":"https://api.github.com/users/hschaefer123/orgs","repos_url":"https://api.github.com/users/hschaefer123/repos","events_url":"https://api.github.com/users/hschaefer123/events{/privacy}","received_events_url":"https://api.github.com/users/hschaefer123/received_events","type":"User","site_admin":false},"labels":[{"id":85376367,"url":"https://api.github.com/repos/SAP/openui5/labels/approved","name":"approved","color":"FFBF7F","default":false},{"id":70015703,"url":"https://api.github.com/repos/SAP/openui5/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-08-08T10:07:23Z","updated_at":"2018-02-16T16:22:39Z","closed_at":null,"author_association":"NONE","body":"OpenUI5 version: 1.38.4\n\nBrowser/version (+device/version): chrome\n\nAny other tested browsers/devices(OK/FAIL): not tested\n\nI am currently binding an odata v2 entityset to a sap.m.list.\n\n```\n<List id=\"lineItemsList\" \n    noDataText=\"{i18n>detailLineItemTableNoDataText}\" \n    busyIndicatorDelay=\"{detailView>/lineItemTableDelay}\"\n    updateFinished=\"onListUpdateFinished\"\n    items=\"{\n        path: 'MeasurementDocuments',\n        sorter: [\n            {\n                path: 'Pttxt',\n                descending: false,\n                group: true\n            }, {\n                path: 'Idate',\n                descending: true\n            }, {\n                path: 'Itime',\n                descending: true\n            }\n        ],\n        groupHeaderFactory: '.getGroupHeader',\n        parameters: {\n            operationMode: 'Client'\n        }\n    }\">\n```\n\nFor performance reason i would like to use client side sorting/filtering.\nInside controller, i am calling the binding sort function this way\n\n``` javascript\nonSelectViewMode: function(oEvent) {\n    var sKey = oEvent.getParameter(\"key\"),\n        oList = this.getView().byId(\"lineItemsList\"),\n        oListBinding = oList.getBinding(\"items\");\n\n    if (sKey === \"DATE\") {\n        oListBinding.sort([\n            {\n                path: \"Idate\",\n                descending: true,\n                group: true\n            }, {\n                path: \"Itime\",\n                descending: true\n            }, {\n                path: \"Pttxt\",\n                descending: false\n            }\n        ]);\n    } else if (sKey === \"TYPE\") {\n        oListBinding.sort([\n            {\n                path: \"Pttxt\",\n                descending: false\n            }, {\n                path: \"Idate\",\n                descending: true\n            }, {\n                path: \"Itime\",\n                descending: true\n            }\n        ]);\n    }\n}\n```\n\nI got the following error:\n\n**ODataMetadata.js:6 Uncaught TypeError: Cannot read property 'replace' of undefined**\n\n``` javascript\n...\n    /**\n    *  extract the property metadata of a specified property of a entity type out of the metadata document\n    */\n    ODataMetadata.prototype._getPropertyMetadata = function(oEntityType, sProperty) {\n        var oPropertyMetadata, that = this;\n\n        if (!oEntityType) {\n            return;\n        }\n\n        // remove starting/trailing /\n        sProperty = sProperty.replace(/^\\/|\\/$/g, \"\"); // <-- error is here because property is empty\n...\n```\n\nInside debugger, sProperty is undefined!\n\nAny ideas?\n\nI think, client side sorting/filtering should be supported out-of-the-box,\nor am i doing something wrong?\n\nWhat is the expected result?\nThe client should sort the resultset clientside \n\nWhat happens instead?\nThrown error\n\nMaybe you got an idea what is causing the issue.\nIf not, please let me know and i have to create a working example with the issue inside.\n\nRegards Holger\n"},"comment":{"url":"https://api.github.com/repos/SAP/openui5/issues/comments/366283258","html_url":"https://github.com/SAP/openui5/issues/1094#issuecomment-366283258","issue_url":"https://api.github.com/repos/SAP/openui5/issues/1094","id":366283258,"user":{"login":"wdwall2","id":36133221,"avatar_url":"https://avatars1.githubusercontent.com/u/36133221?v=4","gravatar_id":"","url":"https://api.github.com/users/wdwall2","html_url":"https://github.com/wdwall2","followers_url":"https://api.github.com/users/wdwall2/followers","following_url":"https://api.github.com/users/wdwall2/following{/other_user}","gists_url":"https://api.github.com/users/wdwall2/gists{/gist_id}","starred_url":"https://api.github.com/users/wdwall2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdwall2/subscriptions","organizations_url":"https://api.github.com/users/wdwall2/orgs","repos_url":"https://api.github.com/users/wdwall2/repos","events_url":"https://api.github.com/users/wdwall2/events{/privacy}","received_events_url":"https://api.github.com/users/wdwall2/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T16:22:39Z","updated_at":"2018-02-16T16:22:39Z","author_association":"NONE","body":"Hi Tobias,\r\nyou are right it is sPath empty. there was an attribute sName instead.\r\nI got it working playing around with the order of filter and filterOperations in the sap.define...\r\nbut it makes no sense to me.\r\nI'm quite puzzled, but i believe it belongs to my learning curve.\r\nThanks for your support\r\nkind regards\r\nwolf"}}
{"actor":{"display_login":"wdwall2"}}