Editable Grid with DevExtreme Data Grid Tutorial

Have you called your function in the onSuccess of your server connect?

I did, this is what mine looks like

Are there any parameters you need to pass to that server connect for it to return data?

no, i am just trying to get your example to work, so it’s a simple ‘Select *’ type query. when I use the same SC with a table generator, it works fine, so I know that SC can query and return data. And btw, thank you very much for helping me and getting back to me

No problem. Can you post the code for the table that server connect is working with.

here you go, is this what you are asking about?

In developer tools in your console can you see what scObjective is outputting?

In case you don’t know how to do this, type dmx.app.data then enter. That will show you all the data wappler is outputting. Mine looks like this…

image

had to look for it under Content

Try dmx.parse(‘content.scObjective.data.queryObjective’)

Found this regarding dmx.parse in a content page - Does dmx.parse work when the serverconnect located inside Content Page?

TIL.

Yup that worked! Now I am trying to get the lookups for the dropdowns inside to work. Thanks much for your help, hopefully I will be able to get that working as well

Excellent! Feel free to ask if you need anymore help.

1 Like

it seems that there is another problem. I would like to have a drop down inside the table that renders my tenants. the tenant is populated and I am able to query the size of it in the beginning of my the_grid() function, so it can see its contents. however, the lookup does not seem to work and the dropdown ‘generates no data to display’. Initially the_grid function did not see the scTenant so I am passing it in as a parameter…

image
image

Is your function calling the data source tenants or v_tenant?

I have tried all options:
{
dataField: ‘TenantID’,
dataType: ‘number’,
lookup: { //create dropdown from countries dataSource
dataSource: tenants,
displayExpr: ‘TenantName’,
valueExpr: ‘TenantID’,
}
}
and

dataField: ‘TenantID’,

        dataType: 'number',

        lookup: { //create dropdown from countries dataSource

            dataSource: v_tenant,

            displayExpr: 'TenantName',

            valueExpr: 'TenantID',

            }

        }

I have a suspicion that in a content page, variables declared outside of $(’#gridContainer’).dxDataGrid() are not being seen

so the problem is the following, if my SC has more than one query in it, nothing works, regardless of how the parsing is being passed. After I changed the SC to join two queries into one (I have to do it to limit data by user identity) everything started to work regardless of how I pass the data to the table. this control is very sensitive to that. Outside of this control, I am able to see the data from any other javascript-based way.

Interesting. I think you’re right that it’s probably a content page issue. I don’t use them so haven’t run across this issue. You’re able to get around it by having multiple server connects though?

i got it working by making sure that my read server connect has only one query in it. My problem was that I originally had two, one to look up user information and then second to use that information to limit only related tenants. This library for whatever reason does not like having more than one query in the API. The next challenge will be to write the update back into the database. Hopefully it will work, in which case this will be a usable component. But I have to say that it’s been a little flaky, not sure if it’s on the datagrid component side or wappler side.

Yeah - integrating custom things can take a bit of work and be a bit flaky depending on the use case. It’s a super sweet component when you get it working though!

I finally got it all working. The secrete sauce is to use GET method for your SC